Package org.apache.calcite.rel.type
Class DelegatingTypeSystem
java.lang.Object
org.apache.calcite.rel.type.DelegatingTypeSystem
- All Implemented Interfaces:
RelDataTypeSystem
Implementation of
RelDataTypeSystem
that sends all methods to an underlying object.-
Field Summary
Fields inherited from interface org.apache.calcite.rel.type.RelDataTypeSystem
DEFAULT
-
Constructor Summary
ModifierConstructorDescriptionprotected
DelegatingTypeSystem
(RelDataTypeSystem typeSystem) Creates aDelegatingTypeSystem
. -
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.deriveTimeFrameSet
(TimeFrameSet frameSet) Returns a list of supported time frames.int
getDefaultPrecision
(SqlTypeName typeName) Returns default precision for this type if supported, otherwiseRelDataType.PRECISION_NOT_SPECIFIED
if precision is either unsupported or must be specified explicitly.int
getDefaultScale
(SqlTypeName typeName) Returns default scale for this type if supported, otherwiseRelDataType.SCALE_NOT_SPECIFIED
if scale 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, orRelDataType.PRECISION_NOT_SPECIFIED
if precision/length are not applicable for this type.int
getMaxScale
(SqlTypeName typeName) Returns the maximum scale allowed for this type, orRelDataType.SCALE_NOT_SPECIFIED
if scale is not applicable for this type.int
getMinPrecision
(SqlTypeName typeName) Returns the minimum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIED
if precision/length are not applicable for this type.int
getMinScale
(SqlTypeName typeName) Returns the minimum scale allowed for this type, orRelDataType.SCALE_NOT_SPECIFIED
if scale are not applicable for this 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.Returns the rounding behavior for numerical operations capable of discarding precision.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, shouldUseDoubleMultiplication
-
Constructor Details
-
DelegatingTypeSystem
Creates aDelegatingTypeSystem
.
-
-
Method Details
-
getMaxScale
Description copied from interface:RelDataTypeSystem
Returns the maximum scale allowed for this type, orRelDataType.SCALE_NOT_SPECIFIED
if scale is not applicable for this type.- Specified by:
getMaxScale
in interfaceRelDataTypeSystem
- Returns:
- Maximum allowed scale
-
getMinScale
Description copied from interface:RelDataTypeSystem
Returns the minimum scale allowed for this type, orRelDataType.SCALE_NOT_SPECIFIED
if scale are not applicable for this type.- Specified by:
getMinScale
in interfaceRelDataTypeSystem
- Returns:
- Minimum allowed scale
-
getDefaultPrecision
Description copied from interface:RelDataTypeSystem
Returns default precision for this type if supported, otherwiseRelDataType.PRECISION_NOT_SPECIFIED
if precision is either unsupported or must be specified explicitly.- Specified by:
getDefaultPrecision
in interfaceRelDataTypeSystem
- Returns:
- Default precision
-
getDefaultScale
Description copied from interface:RelDataTypeSystem
Returns default scale for this type if supported, otherwiseRelDataType.SCALE_NOT_SPECIFIED
if scale is either unsupported or must be specified explicitly.- Specified by:
getDefaultScale
in interfaceRelDataTypeSystem
- Returns:
- Default scale
-
getMaxPrecision
Description copied from interface:RelDataTypeSystem
Returns the maximum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIED
if precision/length are not applicable for this type.- Specified by:
getMaxPrecision
in interfaceRelDataTypeSystem
- Returns:
- Maximum allowed precision
-
getMinPrecision
Description copied from interface:RelDataTypeSystem
Returns the minimum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIED
if precision/length are not applicable for this type.- Specified by:
getMinPrecision
in interfaceRelDataTypeSystem
- Returns:
- Minimum allowed precision
-
getMaxNumericScale
public int getMaxNumericScale()Description copied from interface:RelDataTypeSystem
Returns the maximum scale of a NUMERIC or DECIMAL type. Default value is 19.- Specified by:
getMaxNumericScale
in interfaceRelDataTypeSystem
-
getMaxNumericPrecision
public int getMaxNumericPrecision()Description copied from interface:RelDataTypeSystem
Returns the maximum precision of a NUMERIC or DECIMAL type. Default value is 19.- Specified by:
getMaxNumericPrecision
in interfaceRelDataTypeSystem
-
roundingMode
Description copied from interface:RelDataTypeSystem
Returns the rounding behavior for numerical operations capable of discarding precision.- Specified by:
roundingMode
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
-
deriveTimeFrameSet
Description copied from interface:RelDataTypeSystem
Returns a list of supported time frames.The validator calls this method with
TimeFrames.CORE
as an argument, and the default implementation of this method returns its input, and thereforeCORE
is the default time frame set.If you wish to use a custom time frame set, create an instance of
RelDataTypeSystem
that overrides this method. Your method should callTimeFrameSet.builder()
, will probably add all or most of the time frames in theframeSet
argument, and then callTimeFrameSet.Builder.build()
.- Specified by:
deriveTimeFrameSet
in interfaceRelDataTypeSystem
- Parameters:
frameSet
- Set of built-in time frames
-