public boolean allowsPrec() { return allowsPrecScale(true, true) || allowsPrecScale(true, false); }
public boolean allowsPrec() { return allowsPrecScale(true, true) || allowsPrecScale(true, false); }
public boolean allowsScale() { return allowsPrecScale(true, true); }
public boolean allowsScale() { return allowsPrecScale(true, true); }
/** * Constructs a type with precision/length and scale. * * @param typeName Type name */ public BasicSqlType( SqlTypeName typeName, int precision, int scale) { super(typeName, false, null); assert typeName.allowsPrecScale(true, true); this.precision = precision; this.scale = scale; computeDigest(); }
/** * Constructs a type with precision/length but no scale. * * @param typeName Type name */ public BasicSqlType( SqlTypeName typeName, int precision) { super(typeName, false, null); assert typeName.allowsPrecScale(true, false) : "typeName.allowsPrecScale(true, false)"; this.precision = precision; this.scale = SCALE_NOT_SPECIFIED; computeDigest(); }
/** * Constructs a type with no parameters. This should only be called from a * factory method. * * @param typeName Type name */ public BasicSqlType(SqlTypeName typeName) { super(typeName, false, null); assert typeName.allowsPrecScale(false, false) : "typeName.allowsPrecScale(false,false), typeName=" + typeName.name(); this.precision = PRECISION_NOT_SPECIFIED; this.scale = SCALE_NOT_SPECIFIED; computeDigest(); }
return typeName.allowsPrecScale(true, true) ? typeFactory.createSqlType(typeName, precision, scale) : typeName.allowsPrecScale(true, false) ? typeFactory.createSqlType(typeName, precision) : typeFactory.createSqlType(typeName);
/** * Constructs a type with precision/length but no scale. * * @param typeName Type name * * @pre typeName.allowsPrecNoScale(true,false) */ public BasicSqlType( SqlTypeName typeName, int precision) { super(typeName, false, null); Util.pre( typeName.allowsPrecScale(true, false), "typeName.allowsPrecScale(true,false)"); this.precision = precision; this.scale = SCALE_NOT_SPECIFIED; computeDigest(); }
/** * Constructs a type with precision/length and scale. * * @param typeName Type name * * @pre typeName.allowsPrecScale(true,true) */ public BasicSqlType( SqlTypeName typeName, int precision, int scale) { super(typeName, false, null); Util.pre( typeName.allowsPrecScale(true, true), "typeName.allowsPrecScale(true,true)"); this.precision = precision; this.scale = scale; computeDigest(); }
/** * Constructs a type with no parameters. This should only be called from a * factory method. * * @param typeName Type name * * @pre typeName.allowsNoPrecNoScale(false,false) */ public BasicSqlType(SqlTypeName typeName) { super(typeName, false, null); Util.pre( typeName.allowsPrecScale(false, false), "typeName.allowsPrecScale(false,false), typeName=" + typeName.name()); this.precision = PRECISION_NOT_SPECIFIED; this.scale = SCALE_NOT_SPECIFIED; computeDigest(); }
int scale) assert allowsPrecScale(precision != -1, scale != -1) : this; if (limit == Limit.ZERO) { if (beyond) {
int precision, int scale) { assert allowsPrecScale(precision != -1, scale != -1) : this; if (limit == Limit.ZERO) { if (beyond) {
private RelDataType sqlType(RelDataTypeFactory typeFactory, int dataType, int precision, int scale, String typeString) { SqlTypeName sqlTypeName = SqlTypeName.getNameForJdbcType(dataType); switch (sqlTypeName) { case ARRAY: RelDataType component = null; if (typeString != null && typeString.endsWith(" ARRAY")) { // E.g. hsqldb gives "INTEGER ARRAY", so we deduce the component type // "INTEGER". final String remaining = typeString.substring(0, typeString.length() - " ARRAY".length()); component = parseTypeString(typeFactory, remaining); } if (component == null) { component = typeFactory.createSqlType(SqlTypeName.ANY); } return typeFactory.createArrayType(component, -1); } if (precision >= 0 && scale >= 0 && sqlTypeName.allowsPrecScale(true, true)) { return typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) { return typeFactory.createSqlType(sqlTypeName, precision); } else { assert sqlTypeName.allowsNoPrecNoScale(); return typeFactory.createSqlType(sqlTypeName); } }
private RelDataType zzz(int dataType, int precision, int scale) { SqlTypeName sqlTypeName = SqlTypeName.getNameForJdbcType(dataType); if (precision >= 0 && scale >= 0 && sqlTypeName.allowsPrecScale(true, true)) { return typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) { return typeFactory.createSqlType(sqlTypeName, precision); } else { assert sqlTypeName.allowsNoPrecNoScale(); return typeFactory.createSqlType(sqlTypeName); } }
assert (sqlTypeName.allowsPrecScale(true, true)); type = typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0) {
assert sqlTypeName.allowsPrecScale(true, true); type = typeFactory.createSqlType(sqlTypeName, precision, scale); } else if (precision >= 0) {