Package org.apache.calcite.rel.type
Class DelegatingTypeSystem
- java.lang.Object
-
- org.apache.calcite.rel.type.DelegatingTypeSystem
-
- All Implemented Interfaces:
RelDataTypeSystem
public class DelegatingTypeSystem extends java.lang.Object implements RelDataTypeSystem
Implementation ofRelDataTypeSystem
that sends all methods to an underlying object.
-
-
Field Summary
Fields Modifier and Type Field Description private RelDataTypeSystem
typeSystem
-
Fields inherited from interface org.apache.calcite.rel.type.RelDataTypeSystem
DEFAULT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DelegatingTypeSystem(RelDataTypeSystem typeSystem)
Creates aDelegatingTypeSystem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelDataType
deriveAvgAggType(RelDataTypeFactory typeFactory, RelDataType argumentType)
Returns the return type of a call to theAVG
,STDDEV
orVAR
aggregate functions, inferred from its argument type.RelDataType
deriveCovarType(RelDataTypeFactory typeFactory, RelDataType arg0Type, RelDataType arg1Type)
Returns the return type of a call to theCOVAR
aggregate function, inferred from its argument types.RelDataType
deriveFractionalRankType(RelDataTypeFactory typeFactory)
Returns the return type of theCUME_DIST
andPERCENT_RANK
aggregate functions.RelDataType
deriveRankType(RelDataTypeFactory typeFactory)
Returns the return type of theNTILE
,RANK
,DENSE_RANK
, andROW_NUMBER
aggregate functions.RelDataType
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.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.
-
-
-
Field Detail
-
typeSystem
private final RelDataTypeSystem typeSystem
-
-
Constructor Detail
-
DelegatingTypeSystem
protected DelegatingTypeSystem(RelDataTypeSystem typeSystem)
Creates aDelegatingTypeSystem
.
-
-
Method Detail
-
getMaxScale
public int getMaxScale(SqlTypeName typeName)
Description copied from interface:RelDataTypeSystem
Returns the maximum scale of a given type.- Specified by:
getMaxScale
in interfaceRelDataTypeSystem
-
getDefaultPrecision
public int getDefaultPrecision(SqlTypeName typeName)
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
public int getMaxPrecision(SqlTypeName typeName)
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
public java.lang.String getLiteral(SqlTypeName typeName, boolean isPrefix)
Description copied from interface:RelDataTypeSystem
Returns the LITERAL string for the type, either PREFIX/SUFFIX.- Specified by:
getLiteral
in interfaceRelDataTypeSystem
-
isCaseSensitive
public boolean isCaseSensitive(SqlTypeName typeName)
Description copied from interface:RelDataTypeSystem
Returns whether the type is case sensitive.- Specified by:
isCaseSensitive
in interfaceRelDataTypeSystem
-
isAutoincrement
public boolean isAutoincrement(SqlTypeName typeName)
Description copied from interface:RelDataTypeSystem
Returns whether the type can be auto increment.- Specified by:
isAutoincrement
in interfaceRelDataTypeSystem
-
getNumTypeRadix
public int getNumTypeRadix(SqlTypeName typeName)
Description copied from interface:RelDataTypeSystem
Returns the numeric type radix, typically 2 or 10. 0 means "not applicable".- Specified by:
getNumTypeRadix
in interfaceRelDataTypeSystem
-
deriveSumType
public RelDataType deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType)
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
public RelDataType deriveAvgAggType(RelDataTypeFactory typeFactory, RelDataType argumentType)
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
public RelDataType deriveFractionalRankType(RelDataTypeFactory typeFactory)
Description copied from interface:RelDataTypeSystem
Returns the return type of theCUME_DIST
andPERCENT_RANK
aggregate functions.- Specified by:
deriveFractionalRankType
in interfaceRelDataTypeSystem
-
deriveRankType
public RelDataType deriveRankType(RelDataTypeFactory typeFactory)
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
-
-