public interface RelDataTypeSystem
Provides behaviors concerning type limits and behaviors. For example, in the default system, a DECIMAL can have maximum precision 19, but Hive overrides to 38.
The default implementation is DEFAULT
.
Modifier and Type | Field and Description |
---|---|
static RelDataTypeSystem |
DEFAULT
Default type system.
|
Modifier and Type | Method and Description |
---|---|
RelDataType |
deriveAvgAggType(RelDataTypeFactory typeFactory,
RelDataType argumentType)
Returns the return type of a call to the
AVG , STDDEV or
VAR aggregate functions, inferred from its argument type. |
RelDataType |
deriveCovarType(RelDataTypeFactory typeFactory,
RelDataType arg0Type,
RelDataType arg1Type)
Returns the return type of a call to the
COVAR aggregate function,
inferred from its argument types. |
RelDataType |
deriveFractionalRankType(RelDataTypeFactory typeFactory)
Returns the return type of the
CUME_DIST and PERCENT_RANK
aggregate functions. |
RelDataType |
deriveRankType(RelDataTypeFactory typeFactory)
Returns the return type of the
NTILE , RANK ,
DENSE_RANK , and ROW_NUMBER aggregate functions. |
RelDataType |
deriveSumType(RelDataTypeFactory typeFactory,
RelDataType argumentType)
Returns the return type of a call to the
SUM aggregate function,
inferred from its argument type. |
int |
getDefaultPrecision(SqlTypeName typeName)
Returns default precision for this type if supported, otherwise -1 if
precision is either unsupported or must be specified explicitly.
|
java.lang.String |
getLiteral(SqlTypeName typeName,
boolean isPrefix)
Returns the LITERAL string for the type, either PREFIX/SUFFIX.
|
int |
getMaxNumericPrecision()
Returns the maximum precision of a NUMERIC or DECIMAL type.
|
int |
getMaxNumericScale()
Returns the maximum scale of a NUMERIC or DECIMAL type.
|
int |
getMaxPrecision(SqlTypeName typeName)
Returns the maximum precision (or length) allowed for this type, or -1 if
precision/length are not applicable for this type.
|
int |
getMaxScale(SqlTypeName typeName)
Returns the maximum scale of a given type.
|
int |
getNumTypeRadix(SqlTypeName typeName)
Returns the numeric type radix, typically 2 or 10.
|
boolean |
isAutoincrement(SqlTypeName typeName)
Returns whether the type can be auto increment.
|
boolean |
isCaseSensitive(SqlTypeName typeName)
Returns whether the type is case sensitive.
|
boolean |
isSchemaCaseSensitive()
Whether two record types are considered distinct if their field names
are the same but in different cases.
|
boolean |
shouldConvertRaggedUnionTypesToVarying()
Whether the least restrictive type of a number of CHAR types of different
lengths should be a VARCHAR type.
|
static final RelDataTypeSystem DEFAULT
int getMaxScale(SqlTypeName typeName)
int getDefaultPrecision(SqlTypeName typeName)
int getMaxPrecision(SqlTypeName typeName)
int getMaxNumericScale()
int getMaxNumericPrecision()
java.lang.String getLiteral(SqlTypeName typeName, boolean isPrefix)
boolean isCaseSensitive(SqlTypeName typeName)
boolean isAutoincrement(SqlTypeName typeName)
int getNumTypeRadix(SqlTypeName typeName)
RelDataType deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType)
SUM
aggregate function,
inferred from its argument type.RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory, RelDataType argumentType)
AVG
, STDDEV
or
VAR
aggregate functions, inferred from its argument type.RelDataType deriveCovarType(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type)
COVAR
aggregate function,
inferred from its argument types.RelDataType deriveFractionalRankType(RelDataTypeFactory typeFactory)
CUME_DIST
and PERCENT_RANK
aggregate functions.RelDataType deriveRankType(RelDataTypeFactory typeFactory)
NTILE
, RANK
,
DENSE_RANK
, and ROW_NUMBER
aggregate functions.boolean isSchemaCaseSensitive()
boolean shouldConvertRaggedUnionTypesToVarying()
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.