Package org.apache.calcite.rel.type
Class RelDataTypeSystemImpl
java.lang.Object
org.apache.calcite.rel.type.RelDataTypeSystemImpl
- All Implemented Interfaces:
RelDataTypeSystem
Default implementation of
RelDataTypeSystem
,
providing parameters from the SQL standard.
To implement other type systems, create a derived class and override values as needed.
Parameter | Value |
---|---|
MAX_NUMERIC_SCALE | 19 |
-
Field Summary
Fields inherited from interface org.apache.calcite.rel.type.RelDataTypeSystem
DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionderiveAvgAggType
(RelDataTypeFactory typeFactory, RelDataType argumentType) Returns the return type of a call to theAVG
,STDDEV
orVAR
aggregate functions, inferred from its argument type.deriveCovarType
(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type) Returns the return type of a call to theCOVAR
aggregate function, inferred from its argument types.deriveFractionalRankType
(RelDataTypeFactory typeFactory) Returns the return type of theCUME_DIST
andPERCENT_RANK
aggregate functions.deriveRankType
(RelDataTypeFactory typeFactory) Returns the return type of theNTILE
,RANK
,DENSE_RANK
, andROW_NUMBER
aggregate functions.deriveSumType
(RelDataTypeFactory typeFactory, RelDataType argumentType) Returns the return type of a call to theSUM
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.@Nullable String
getLiteral
(SqlTypeName typeName, boolean isPrefix) Returns the LITERAL string for the type, either PREFIX/SUFFIX.int
Returns the maximum precision of a NUMERIC or DECIMAL type.int
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
Whether two record types are considered distinct if their field names are the same but in different cases.boolean
Whether the least restrictive type of a number of CHAR types of different lengths should be a VARCHAR type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.type.RelDataTypeSystem
deriveDecimalDivideType, deriveDecimalModType, deriveDecimalMultiplyType, deriveDecimalPlusType, deriveTimeFrameSet, shouldUseDoubleMultiplication
-
Constructor Details
-
RelDataTypeSystemImpl
public RelDataTypeSystemImpl()
-
-
Method Details
-
getMaxScale
Description copied from interface:RelDataTypeSystem
Returns the maximum scale of a given type.- Specified by:
getMaxScale
in interfaceRelDataTypeSystem
-
getDefaultPrecision
Description copied from interface:RelDataTypeSystem
Returns default precision for this type if supported, otherwise -1 if precision is either unsupported or must be specified explicitly.- Specified by:
getDefaultPrecision
in interfaceRelDataTypeSystem
- Returns:
- Default precision
-
getMaxPrecision
Description copied from interface:RelDataTypeSystem
Returns the maximum precision (or length) allowed for this type, or -1 if precision/length are not applicable for this type.- Specified by:
getMaxPrecision
in interfaceRelDataTypeSystem
- Returns:
- Maximum allowed precision
-
getMaxNumericScale
public int getMaxNumericScale()Description copied from interface:RelDataTypeSystem
Returns the maximum scale of a NUMERIC or DECIMAL type.- Specified by:
getMaxNumericScale
in interfaceRelDataTypeSystem
-
getMaxNumericPrecision
public int getMaxNumericPrecision()Description copied from interface:RelDataTypeSystem
Returns the maximum precision of a NUMERIC or DECIMAL type.- Specified by:
getMaxNumericPrecision
in interfaceRelDataTypeSystem
-
getLiteral
Description copied from interface:RelDataTypeSystem
Returns the LITERAL string for the type, either PREFIX/SUFFIX.- Specified by:
getLiteral
in interfaceRelDataTypeSystem
-
isCaseSensitive
Description copied from interface:RelDataTypeSystem
Returns whether the type is case sensitive.- Specified by:
isCaseSensitive
in interfaceRelDataTypeSystem
-
isAutoincrement
Description copied from interface:RelDataTypeSystem
Returns whether the type can be auto increment.- Specified by:
isAutoincrement
in interfaceRelDataTypeSystem
-
getNumTypeRadix
Description copied from interface:RelDataTypeSystem
Returns the numeric type radix, typically 2 or 10. 0 means "not applicable".- Specified by:
getNumTypeRadix
in interfaceRelDataTypeSystem
-
deriveSumType
Description copied from interface:RelDataTypeSystem
Returns the return type of a call to theSUM
aggregate function, inferred from its argument type.- Specified by:
deriveSumType
in interfaceRelDataTypeSystem
-
deriveAvgAggType
Description copied from interface:RelDataTypeSystem
Returns the return type of a call to theAVG
,STDDEV
orVAR
aggregate functions, inferred from its argument type.- Specified by:
deriveAvgAggType
in interfaceRelDataTypeSystem
-
deriveCovarType
public RelDataType deriveCovarType(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type) Description copied from interface:RelDataTypeSystem
Returns the return type of a call to theCOVAR
aggregate function, inferred from its argument types.- Specified by:
deriveCovarType
in interfaceRelDataTypeSystem
-
deriveFractionalRankType
Description copied from interface:RelDataTypeSystem
Returns the return type of theCUME_DIST
andPERCENT_RANK
aggregate functions.- Specified by:
deriveFractionalRankType
in interfaceRelDataTypeSystem
-
deriveRankType
Description copied from interface:RelDataTypeSystem
Returns the return type of theNTILE
,RANK
,DENSE_RANK
, andROW_NUMBER
aggregate functions.- Specified by:
deriveRankType
in interfaceRelDataTypeSystem
-
isSchemaCaseSensitive
public boolean isSchemaCaseSensitive()Description copied from interface:RelDataTypeSystem
Whether two record types are considered distinct if their field names are the same but in different cases.- Specified by:
isSchemaCaseSensitive
in interfaceRelDataTypeSystem
-
shouldConvertRaggedUnionTypesToVarying
public boolean shouldConvertRaggedUnionTypesToVarying()Description copied from interface:RelDataTypeSystem
Whether the least restrictive type of a number of CHAR types of different lengths should be a VARCHAR type. And similarly BINARY to VARBINARY.- Specified by:
shouldConvertRaggedUnionTypesToVarying
in interfaceRelDataTypeSystem
-