public RelDataType inferReturnType(SqlOperatorBinding opBinding) { assert opBinding.getOperandCount() == 1; final RelDataType multisetType = opBinding.getOperandType(0); RelDataType componentType = multisetType.getComponentType(); assert componentType != null : "expected a multiset type: " + multisetType; final RelDataTypeFactory typeFactory = opBinding.getTypeFactory(); final RelDataType type = typeFactory.builder().add(SqlUtil.deriveAliasFromOrdinal(0), componentType).build(); return typeFactory.createMultisetType(type, -1); }
public RelDataType inferReturnType(SqlOperatorBinding opBinding) { assert opBinding.getOperandCount() == 1; final RelDataType recordMultisetType = opBinding.getOperandType(0); RelDataType multisetType = recordMultisetType.getComponentType(); assert multisetType != null : "expected a multiset type: " + recordMultisetType; final List<RelDataTypeField> fields = multisetType.getFieldList(); assert fields.size() > 0; final RelDataType firstColType = fields.get(0).getType(); return opBinding.getTypeFactory().createMultisetType(firstColType, -1); }