private Set<RelColumnMapping> getColumnMappings(SqlOperator op) { SqlReturnTypeInference rti = op.getReturnTypeInference(); if (rti == null) { return null; } if (rti instanceof TableFunctionReturnTypeInference) { TableFunctionReturnTypeInference tfrti = (TableFunctionReturnTypeInference) rti; return tfrti.getColumnMappings(); } else { return null; } }
/** * Returns the type for a histogram function. It is either the actual * type or an an approximation to it. */ private RelDataType computeHistogramType(RelDataType type) { if (SqlTypeUtil.isExactNumeric(type) && type.getSqlTypeName() != SqlTypeName.BIGINT) { return typeFactory.createSqlType(SqlTypeName.BIGINT); } else if (SqlTypeUtil.isApproximateNumeric(type) && type.getSqlTypeName() != SqlTypeName.DOUBLE) { return typeFactory.createSqlType(SqlTypeName.DOUBLE); } else { return type; } } }
public RelDataType createSqlType( SqlTypeName typeName, int precision) { assertBasic(typeName); assert (precision >= 0) || (precision == RelDataType.PRECISION_NOT_SPECIFIED); RelDataType newType = new BasicSqlType(typeName, precision); newType = SqlTypeUtil.addCharsetAndCollation(newType, this); return canonize(newType); }
public RelDataType createSqlType( SqlTypeName typeName, int precision) { if (typeName.allowsScale()) { return createSqlType(typeName, precision, typeName.getDefaultScale()); } assertBasic(typeName); assert (precision >= 0) || (precision == RelDataType.PRECISION_NOT_SPECIFIED); RelDataType newType = new BasicSqlType(typeName, precision); newType = SqlTypeUtil.addCharsetAndCollation(newType, this); return canonize(newType); }
public RelDataType createSqlType(SqlTypeName typeName) { if (typeName.allowsPrec()) { return createSqlType(typeName, typeName.getDefaultPrecision()); } assertBasic(typeName); RelDataType newType = new BasicSqlType(typeName); return canonize(newType); }
private RelDataType copyMultisetType(RelDataType type, boolean nullable) { MultisetSqlType mt = (MultisetSqlType) type; RelDataType elementType = copyType(mt.getComponentType()); return new MultisetSqlType(elementType, nullable); }
public RelDataType createSqlType(SqlTypeName typeName) { assertBasic(typeName); RelDataType newType = new BasicSqlType(typeName); return canonize(newType); }
public RelDataType createSqlIntervalType( SqlIntervalQualifier intervalQualifier) { RelDataType newType = new IntervalSqlType(intervalQualifier, false); return canonize(newType); }
public RelDataType createMapType( RelDataType keyType, RelDataType valueType) { MapSqlType newType = new MapSqlType(keyType, valueType, false); return canonize(newType); }
public boolean contains(RelDataType type) { return SqlTypeUtil.isOfSameTypeName(getTypeNames(), type); } }
public RelDataType createMultisetType( RelDataType type, long maxCardinality) { assert maxCardinality == -1; RelDataType newType = new MultisetSqlType(type, false); return canonize(newType); }
public boolean checkOperandTypes( SqlCallBinding callBinding, boolean throwOnFailure) { if (!super.checkOperandTypes(callBinding, throwOnFailure)) { return false; } return SAME_SAME.checkOperandTypes(callBinding, throwOnFailure); } };
public RelDataType createArrayType( RelDataType elementType, long maxCardinality) { assert maxCardinality == -1; ArraySqlType newType = new ArraySqlType(elementType, false); return canonize(newType); }
} else { rowType = SqlTypeUtil.promoteToRowType( typeFactory, validator.getValidatedNodeType(rowList),
if (SqlTypeUtil.isExactNumeric(type)) { BigDecimal roundedValue = NumberUtil.rescaleBigDecimal(
public RelDataType createSqlType( SqlTypeName typeName, int precision, int scale) { assertBasic(typeName); assert (precision >= 0) || (precision == RelDataType.PRECISION_NOT_SPECIFIED); RelDataType newType = new BasicSqlType(typeName, precision, scale); newType = SqlTypeUtil.addCharsetAndCollation(newType, this); return canonize(newType); }
public RelDataType createSqlIntervalType( SqlIntervalQualifier intervalQualifier) { RelDataType newType = new IntervalSqlType(intervalQualifier, false); return canonize(newType); }
public RelDataType createMapType( RelDataType keyType, RelDataType valueType) { MapSqlType newType = new MapSqlType(keyType, valueType, false); return canonize(newType); }
public boolean contains(RelDataType type) { return SqlTypeUtil.isOfSameTypeName(getTypeNames(), type); } }
public RelDataType createSqlType( SqlTypeName typeName, int precision, int scale) { assertBasic(typeName); assert (precision >= 0) || (precision == RelDataType.PRECISION_NOT_SPECIFIED); RelDataType newType = new BasicSqlType(typeName, precision, scale); newType = SqlTypeUtil.addCharsetAndCollation(newType, this); return canonize(newType); }