private RelDataType copyMultisetType(RelDataType type, boolean nullable) { MultisetSqlType mt = (MultisetSqlType) type; RelDataType elementType = copyType(mt.getComponentType()); return new MultisetSqlType(elementType, nullable); }
private RelDataType copyMultisetType(RelDataType type, boolean nullable) { MultisetSqlType mt = (MultisetSqlType) type; RelDataType elementType = copyType(mt.getComponentType()); return new MultisetSqlType(elementType, nullable); }
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(); }
/** * 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(); }
/** * 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(); }
((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; }