&& sqlTypeName.allowsPrecScale(true, true)) { return typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) { return typeFactory.createSqlType(sqlTypeName, precision); } else {
&& sqlTypeName.allowsPrecScale(true, true)) { return typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) { return typeFactory.createSqlType(sqlTypeName, precision); } else {
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // Here we know all the operands have the same type, // which has a size (precision), but not a scale. RelDataType ret = opBinding.getOperandType(0); SqlTypeName typeName = ret.getSqlTypeName(); assert typeName.allowsPrecNoScale() : "LiteralChain has impossible operand type " + typeName; int size = 0; for (RelDataType type : opBinding.collectOperandTypes()) { size += type.getPrecision(); assert type.getSqlTypeName() == typeName; } return opBinding.getTypeFactory().createSqlType(typeName, size); }
public RelDataType inferReturnType( SqlOperatorBinding opBinding) { // Here we know all the operands have the same type, // which has a size (precision), but not a scale. RelDataType ret = opBinding.getOperandType(0); SqlTypeName typeName = ret.getSqlTypeName(); assert typeName.allowsPrecNoScale() : "LiteralChain has impossible operand type " + typeName; int size = 0; for (RelDataType type : opBinding.collectOperandTypes()) { size += type.getPrecision(); assert type.getSqlTypeName() == typeName; } return opBinding.getTypeFactory().createSqlType(typeName, size); }
type = typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0) { assert sqlTypeName.allowsPrecNoScale(); type = typeFactory.createSqlType(sqlTypeName, precision); } else {
type = typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0) { assert sqlTypeName.allowsPrecNoScale(); type = typeFactory.createSqlType(sqlTypeName, precision); } else {
if (inputType.getSqlTypeName().allowsPrecNoScale()) { RelDataType type = factory.createSqlType(sqlTypeName, inputType.getPrecision()); return factory.createTypeWithNullability(type, isNullable);