private RelDataType copyMultisetType(RelDataType type, boolean nullable) { MultisetSqlType mt = (MultisetSqlType) type; RelDataType elementType = copyType(mt.getComponentType()); return new MultisetSqlType(elementType, nullable); }
/** * Constructs a new MultisetSqlType. This constructor should only be called * from a factory method. */ public MultisetSqlType(RelDataType elementType, boolean isNullable) { super(SqlTypeName.MULTISET, isNullable, null); assert elementType != null; this.elementType = elementType; computeDigest(); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { RelDataType type = opBinding.getOperandType(0); if (type.isStruct()) { type = type.getFieldList().get(0).getType(); } MultisetSqlType t = (MultisetSqlType) type; return t.getComponentType(); }
public RelDataType createMultisetType( RelDataType type, long maxCardinality) { assert maxCardinality == -1; RelDataType newType = new MultisetSqlType(type, false); return canonize(newType); }
/** * Returns the type of the argument to UNNEST. */ private RelDataType inferReturnType() { final SqlNode operand = unnest.operand(0); RelDataType type = validator.getValidatedNodeType(operand); // If sub-query, pick out first column. // TODO: Handle this using usual sub-select validation. if (type.isStruct()) { type = type.getFieldList().get(0).getType(); } MultisetSqlType t = (MultisetSqlType) type; return t.getComponentType(); }
public RelDataType createMultisetType( RelDataType type, long maxCardinality) { assert (maxCardinality == -1); RelDataType newType = new MultisetSqlType(type, false); return canonize(newType); }
private RelDataType copyMultisetType(RelDataType type, boolean nullable) { MultisetSqlType mt = (MultisetSqlType) type; RelDataType elementType = copyType(mt.getComponentType()); return new MultisetSqlType(elementType, nullable); }
/** * Returns the type of the argument to UNNEST. */ private RelDataType inferReturnType() { final SqlNode operand = unnest.getOperands()[0]; RelDataType type = validator.getValidatedNodeType(operand); // If sub-query, pick out first column. // TODO: Handle this using usual sub-select validation. if (type.isStruct()) { type = type.getFieldList().get(0).getType(); } MultisetSqlType t = (MultisetSqlType) type; return t.getComponentType(); }
/** * Constructs a new MultisetSqlType. This constructor should only be called * from a factory method. * * @pre null!=elementType */ public MultisetSqlType(RelDataType elementType, boolean isNullable) { super(SqlTypeName.MULTISET, isNullable, null); Util.pre(null != elementType, "null!=elementType"); this.elementType = elementType; computeDigest(); }
((MultisetSqlType) type).getComponentType(); final RelDataTypeFactory typeFactory = validator.getTypeFactory(); if (componentType.isStruct()) { && ((MultisetSqlType) type).getComponentType().isStruct() : type; return type;
callBinding.getScope(), callBinding.getCall().operands[0]); RelDataType t1 = mt.getComponentType();
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!OperandTypes.MULTISET.checkSingleOperandType( callBinding, callBinding.getCall().operand(1), 0, throwOnFailure)) { return false; } MultisetSqlType mt = (MultisetSqlType) callBinding.getValidator().deriveType( callBinding.getScope(), callBinding.getCall().operand(1)); RelDataType t0 = callBinding.getValidator().deriveType( callBinding.getScope(), callBinding.getCall().operand(0)); RelDataType t1 = mt.getComponentType(); if (t0.getFamily() != t1.getFamily()) { if (throwOnFailure) { throw callBinding.newValidationError( RESOURCE.typeNotComparableNear(t0.toString(), t1.toString())); } return false; } return true; }