/** * 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; } } }
final RelDataType nullableBooleanType = typeFactory.createTypeWithNullability( typeFactory.createSqlType(SqlTypeName.BOOLEAN), true); final RelDataType longType = typeFactory.createSqlType(SqlTypeName.BIGINT); final RexNode cRef = rexBuilder.makeInputRef(root, leftLeftCount); final RexNode ckRef = rexBuilder.makeInputRef(root, leftLeftCount + 1);
public void inferOperandTypes( SqlCallBinding callBinding, RelDataType returnType, RelDataType[] operandTypes) { RelDataTypeFactory typeFactory = callBinding.getTypeFactory(); for (int i = 0; i < operandTypes.length; ++i) { operandTypes[i] = typeFactory.createSqlType(SqlTypeName.BOOLEAN); } } };
/** * Creates a BIGINT literal. */ public RexLiteral makeBigintLiteral(BigDecimal bd) { RelDataType bigintType = typeFactory.createSqlType( SqlTypeName.BIGINT); return makeLiteral(bd, bigintType, SqlTypeName.DECIMAL); }
/** * Creates a Date literal. */ public RexLiteral makeDateLiteral(Calendar date) { assert date != null; return makeLiteral( date, typeFactory.createSqlType(SqlTypeName.DATE), SqlTypeName.DATE); }
/** * Creates a Time literal. */ public RexLiteral makeTimeLiteral( Calendar time, int precision) { assert time != null; return makeLiteral( time, typeFactory.createSqlType(SqlTypeName.TIME, precision), SqlTypeName.TIME); }
public RelDataType apply(RelDataTypeFactory typeFactory) { final RelDataType type = typeFactory.createSqlType(typeName); return typeFactory.createTypeWithNullability(type, nullable); } };
public void inferOperandTypes( SqlCallBinding callBinding, RelDataType returnType, RelDataType [] operandTypes) { RelDataTypeFactory typeFactory = callBinding.getTypeFactory(); for (int i = 0; i < operandTypes.length; ++i) { operandTypes[i] = typeFactory.createSqlType(SqlTypeName.VARCHAR, 1024); } } };
/** * Creates a BIGINT literal. */ public RexLiteral makeBigintLiteral(BigDecimal bd) { RelDataType bigintType = typeFactory.createSqlType( SqlTypeName.BIGINT); return makeLiteral(bd, bigintType, SqlTypeName.DECIMAL); }
public void inferOperandTypes( SqlCallBinding callBinding, RelDataType returnType, RelDataType[] operandTypes) { RelDataTypeFactory typeFactory = callBinding.getTypeFactory(); for (int i = 0; i < operandTypes.length; ++i) { operandTypes[i] = typeFactory.createSqlType(SqlTypeName.VARCHAR, 1024); } } };
/** * Adds a field with a type created using * {@link org.eigenbase.reltype.RelDataTypeFactory#createSqlType(org.eigenbase.sql.type.SqlTypeName, int)}. */ public FieldInfoBuilder add( String name, SqlTypeName typeName, int precision) { add(name, typeFactory.createSqlType(typeName, precision)); return this; }
/** * Constructs a RexExpander */ public RexExpander(RexBuilder builder) { this.builder = builder; int8 = builder.getTypeFactory().createSqlType(SqlTypeName.BIGINT); real8 = builder.getTypeFactory().createSqlType(SqlTypeName.DOUBLE); }
/** * Creates a literal representing a flag. * * @param flag Flag value */ public RexLiteral makeFlag(Enum flag) { assert flag != null; return makeLiteral(flag, typeFactory.createSqlType(SqlTypeName.SYMBOL), SqlTypeName.SYMBOL); }
public static RelDataType deriveOneRowType(RelDataTypeFactory typeFactory) { return typeFactory.createStructType( new RelDataType[] { typeFactory.createSqlType( SqlTypeName.INTEGER) }, new String[] { "ZERO" }); } }
public RelDataType createSqlType(RelDataTypeFactory typeFactory) { return typeFactory.createSqlType(getTypeName()); }
/** * Creates a double-precision literal. */ public RexLiteral makeApproxLiteral(BigDecimal bd) { // Validator should catch if underflow is allowed // If underflow is allowed, let underflow become zero if (bd.doubleValue() == 0) { bd = BigDecimal.ZERO; } return makeApproxLiteral(bd, typeFactory.createSqlType(SqlTypeName.DOUBLE)); }
public RelDataType apply(RelDataTypeFactory typeFactory) { final RelDataType type = typeFactory.createSqlType(typeName, precision); return typeFactory.createTypeWithNullability(type, nullable); } };
typeFactory.createSqlType(SqlTypeName.BIGINT); final RelNode seek = converted.left.getInput(0); // fragile final int keyCount = leftKeys.size();
public RelDataType createSqlType(RelDataTypeFactory typeFactory) { return typeFactory.createSqlType( getTypeName(), getPrec()); }
/** * Creates a byte array literal. */ public RexLiteral makeBinaryLiteral(ByteString byteString) { return makeLiteral( byteString, typeFactory.createSqlType(SqlTypeName.BINARY, byteString.length()), SqlTypeName.BINARY); }