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 |
| MIN_NUMERIC_SCALE | 0 |
| MAX_NUMERIC_PRECISION | 19 |
-
Field Summary
Fields inherited from interface org.apache.calcite.rel.type.RelDataTypeSystem
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderiveAvgAggType(RelDataTypeFactory typeFactory, RelDataType argumentType) Returns the return type of a call to theAVG,STDDEVorVARaggregate functions, inferred from its argument type.deriveCovarType(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type) Returns the return type of a call to theCOVARaggregate function, inferred from its argument types.deriveFractionalRankType(RelDataTypeFactory typeFactory) Returns the return type of theCUME_DISTandPERCENT_RANKaggregate functions.deriveRankType(RelDataTypeFactory typeFactory) Returns the return type of theNTILE,RANK,DENSE_RANK, andROW_NUMBERaggregate functions.deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType) Returns the return type of a call to theSUMaggregate function, inferred from its argument type.intgetDefaultPrecision(SqlTypeName typeName) Returns default precision for this type if supported, otherwiseRelDataType.PRECISION_NOT_SPECIFIEDif precision is either unsupported or must be specified explicitly.intgetDefaultScale(SqlTypeName typeName) Returns the default scale for this type if supported, otherwiseRelDataType.SCALE_NOT_SPECIFIEDif scale is either unsupported or must be specified explicitly.@Nullable StringgetLiteral(SqlTypeName typeName, boolean isPrefix) Returns the LITERAL string for the type, either PREFIX/SUFFIX.intReturns the maximum precision of a NUMERIC or DECIMAL type.intReturns the maximum scale of a NUMERIC or DECIMAL type.intgetMaxPrecision(SqlTypeName typeName) Returns the maximum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIEDif precision/length are not applicable for this type.intgetMaxScale(SqlTypeName typeName) Returns the maximum scale allowed for this type, orRelDataType.SCALE_NOT_SPECIFIEDif scale is not applicable for this type.intgetMinPrecision(SqlTypeName typeName) Returns the minimum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIEDif precision/length are not applicable for this type.intgetMinScale(SqlTypeName typeName) Returns the minimum scale (or fractional second precision in the case of intervals) allowed for this type, orRelDataType.SCALE_NOT_SPECIFIEDif precision/length are not applicable for this type.intgetNumTypeRadix(SqlTypeName typeName) Returns the numeric type radix, typically 2 or 10.booleanisAutoincrement(SqlTypeName typeName) Returns whether the type can be auto increment.booleanisCaseSensitive(SqlTypeName typeName) Returns whether the type is case sensitive.booleanWhether 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.booleanWhether 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, waitMethods inherited from interface org.apache.calcite.rel.type.RelDataTypeSystem
deriveDecimalDivideType, deriveDecimalModType, deriveDecimalMultiplyType, deriveDecimalPlusType, deriveTimeFrameSet, mapKeysCanBeNullable, shouldUseDoubleMultiplication
-
Constructor Details
-
RelDataTypeSystemImpl
public RelDataTypeSystemImpl()
-
-
Method Details
-
getMaxScale
Description copied from interface:RelDataTypeSystemReturns the maximum scale allowed for this type, orRelDataType.SCALE_NOT_SPECIFIEDif scale is not applicable for this type.- Specified by:
getMaxScalein interfaceRelDataTypeSystem- Returns:
- Maximum allowed scale
-
getMinScale
Returns the minimum scale (or fractional second precision in the case of intervals) allowed for this type, orRelDataType.SCALE_NOT_SPECIFIEDif precision/length are not applicable for this type.- Specified by:
getMinScalein interfaceRelDataTypeSystem- Returns:
- Minimum allowed scale
-
getDefaultPrecision
Description copied from interface:RelDataTypeSystemReturns default precision for this type if supported, otherwiseRelDataType.PRECISION_NOT_SPECIFIEDif precision is either unsupported or must be specified explicitly.- Specified by:
getDefaultPrecisionin interfaceRelDataTypeSystem- Returns:
- Default precision
-
getDefaultScale
Returns the default scale for this type if supported, otherwiseRelDataType.SCALE_NOT_SPECIFIEDif scale is either unsupported or must be specified explicitly.- Specified by:
getDefaultScalein interfaceRelDataTypeSystem- Returns:
- Default scale
-
getMaxPrecision
Description copied from interface:RelDataTypeSystemReturns the maximum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIEDif precision/length are not applicable for this type.- Specified by:
getMaxPrecisionin interfaceRelDataTypeSystem- Returns:
- Maximum allowed precision
-
getMinPrecision
Returns the minimum precision (or length) allowed for this type, orRelDataType.PRECISION_NOT_SPECIFIEDif precision/length are not applicable for this type.- Specified by:
getMinPrecisionin interfaceRelDataTypeSystem- Returns:
- Minimum allowed precision
-
getMaxNumericScale
public int getMaxNumericScale()Description copied from interface:RelDataTypeSystemReturns the maximum scale of a NUMERIC or DECIMAL type. Default value is 19.- Specified by:
getMaxNumericScalein interfaceRelDataTypeSystem
-
getMaxNumericPrecision
public int getMaxNumericPrecision()Description copied from interface:RelDataTypeSystemReturns the maximum precision of a NUMERIC or DECIMAL type. Default value is 19.- Specified by:
getMaxNumericPrecisionin interfaceRelDataTypeSystem
-
roundingMode
Description copied from interface:RelDataTypeSystemReturns the rounding behavior for numerical operations capable of discarding precision.- Specified by:
roundingModein interfaceRelDataTypeSystem
-
getLiteral
Description copied from interface:RelDataTypeSystemReturns the LITERAL string for the type, either PREFIX/SUFFIX.- Specified by:
getLiteralin interfaceRelDataTypeSystem
-
isCaseSensitive
Description copied from interface:RelDataTypeSystemReturns whether the type is case sensitive.- Specified by:
isCaseSensitivein interfaceRelDataTypeSystem
-
isAutoincrement
Description copied from interface:RelDataTypeSystemReturns whether the type can be auto increment.- Specified by:
isAutoincrementin interfaceRelDataTypeSystem
-
getNumTypeRadix
Description copied from interface:RelDataTypeSystemReturns the numeric type radix, typically 2 or 10. 0 means "not applicable".- Specified by:
getNumTypeRadixin interfaceRelDataTypeSystem
-
deriveSumType
Description copied from interface:RelDataTypeSystemReturns the return type of a call to theSUMaggregate function, inferred from its argument type.- Specified by:
deriveSumTypein interfaceRelDataTypeSystem
-
deriveAvgAggType
Description copied from interface:RelDataTypeSystemReturns the return type of a call to theAVG,STDDEVorVARaggregate functions, inferred from its argument type.- Specified by:
deriveAvgAggTypein interfaceRelDataTypeSystem
-
deriveCovarType
public RelDataType deriveCovarType(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type) Description copied from interface:RelDataTypeSystemReturns the return type of a call to theCOVARaggregate function, inferred from its argument types.- Specified by:
deriveCovarTypein interfaceRelDataTypeSystem
-
deriveFractionalRankType
Description copied from interface:RelDataTypeSystemReturns the return type of theCUME_DISTandPERCENT_RANKaggregate functions.- Specified by:
deriveFractionalRankTypein interfaceRelDataTypeSystem
-
deriveRankType
Description copied from interface:RelDataTypeSystemReturns the return type of theNTILE,RANK,DENSE_RANK, andROW_NUMBERaggregate functions.- Specified by:
deriveRankTypein interfaceRelDataTypeSystem
-
isSchemaCaseSensitive
public boolean isSchemaCaseSensitive()Description copied from interface:RelDataTypeSystemWhether two record types are considered distinct if their field names are the same but in different cases.- Specified by:
isSchemaCaseSensitivein interfaceRelDataTypeSystem
-
shouldConvertRaggedUnionTypesToVarying
public boolean shouldConvertRaggedUnionTypesToVarying()Description copied from interface:RelDataTypeSystemWhether 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:
shouldConvertRaggedUnionTypesToVaryingin interfaceRelDataTypeSystem
-