public class SqlTypeFactoryImpl extends RelDataTypeFactoryImpl
RelDataTypeFactory which supports SQL types.RelDataTypeFactoryImpl.JavaTypeRelDataTypeFactory.FieldInfo, RelDataTypeFactory.FieldInfoBuildertypeSystem| Constructor and Description |
|---|
SqlTypeFactoryImpl(RelDataTypeSystem typeSystem) |
| Modifier and Type | Method and Description |
|---|---|
protected RelDataType |
canonize(RelDataType type)
Registers a type, or returns the existing type if it is already
registered.
|
RelDataType |
createArrayType(RelDataType elementType,
long maxCardinality)
Creates an array type.
|
RelDataType |
createMapType(RelDataType keyType,
RelDataType valueType)
Creates a map type.
|
RelDataType |
createMultisetType(RelDataType type,
long maxCardinality)
Creates a multiset type.
|
RelDataType |
createSqlIntervalType(SqlIntervalQualifier intervalQualifier)
Creates a SQL interval type.
|
RelDataType |
createSqlType(SqlTypeName typeName)
Creates a SQL type with no precision or scale.
|
RelDataType |
createSqlType(SqlTypeName typeName,
int precision)
Creates a SQL type with length (precision) but no scale.
|
RelDataType |
createSqlType(SqlTypeName typeName,
int precision,
int scale)
Creates a SQL type with precision and scale.
|
RelDataType |
createTypeWithCharsetAndCollation(RelDataType type,
Charset charset,
SqlCollation collation)
Creates a Type which is the same as another type but with possibly
different charset or collation.
|
RelDataType |
createTypeWithNullability(RelDataType type,
boolean nullable)
Creates a type which is the same as another type but with possibly
different nullability.
|
RelDataType |
leastRestrictive(List<RelDataType> types)
Returns the most general of a set of types (that is, one type to which
they can all be cast), or null if conversion is not possible.
|
protected boolean |
shouldRaggedFixedLengthValueUnionBeVariable()
Controls behavior discussed here.
|
builder, canonize, copyType, createDecimalProduct, createDecimalQuotient, createJavaType, createJoinType, createStructType, createStructType, createStructType, getDefaultCharset, getTypeSystem, isJavaType, leastRestrictiveStructuredType, useDoubleMultiplicationpublic SqlTypeFactoryImpl(RelDataTypeSystem typeSystem)
public RelDataType createSqlType(SqlTypeName typeName)
RelDataTypeFactorytypeName - Name of the type, for example SqlTypeName.BOOLEAN,
never nullpublic RelDataType createSqlType(SqlTypeName typeName, int precision)
RelDataTypeFactorytypeName - Name of the type, for example SqlTypeName.VARCHAR.
Never null.precision - Maximum length of the value (non-numeric types) or the
precision of the value (numeric/datetime types).
Must be non-negative or
RelDataType.PRECISION_NOT_SPECIFIED.public RelDataType createSqlType(SqlTypeName typeName, int precision, int scale)
RelDataTypeFactorytypeName - Name of the type, for example SqlTypeName.DECIMAL.
Never null.precision - Precision of the value.
Must be non-negative or
RelDataType.PRECISION_NOT_SPECIFIED.scale - scale of the values, i.e. the number of decimal places to
shift the value. For example, a NUMBER(10,3) value of
"123.45" is represented "123450" (that is, multiplied by
10^3). A negative scale is valid.public RelDataType createMultisetType(RelDataType type, long maxCardinality)
RelDataTypeFactorytype - type of the elements of the multisetmaxCardinality - maximum collection size, or -1 for unlimitedpublic RelDataType createArrayType(RelDataType elementType, long maxCardinality)
RelDataTypeFactoryelementType - type of the elements of the arraymaxCardinality - maximum array size, or -1 for unlimitedpublic RelDataType createMapType(RelDataType keyType, RelDataType valueType)
RelDataTypeFactorykeyType - type of the keys of the mapvalueType - type of the values of the mappublic RelDataType createSqlIntervalType(SqlIntervalQualifier intervalQualifier)
RelDataTypeFactoryintervalQualifier - contains information if it is a year-month or a
day-time interval along with precision informationpublic RelDataType createTypeWithCharsetAndCollation(RelDataType type, Charset charset, SqlCollation collation)
RelDataTypeFactorytype - input typecharset - charset to assigncollation - collation to assignpublic RelDataType leastRestrictive(List<RelDataType> types)
RelDataTypeFactoryleastRestrictive(INT, NUMERIC(3, 2)) could be
NUMERIC(12, 2).leastRestrictive in interface RelDataTypeFactoryleastRestrictive in class RelDataTypeFactoryImpltypes - input types to be combined using union (not null, not empty)public RelDataType createTypeWithNullability(RelDataType type, boolean nullable)
RelDataTypeFactorycreateTypeWithNullability in interface RelDataTypeFactorycreateTypeWithNullability in class RelDataTypeFactoryImpltype - input typenullable - true to request a nullable type; false to request a NOT
NULL typeprotected boolean shouldRaggedFixedLengthValueUnionBeVariable()
protected RelDataType canonize(RelDataType type)
RelDataTypeFactoryImplcanonize in class RelDataTypeFactoryImplCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.