Package org.apache.calcite.rel.type
Class RelDataTypeFactoryImpl.JavaType
java.lang.Object
org.apache.calcite.rel.type.RelDataTypeImpl
org.apache.calcite.rel.type.RelDataTypeFactoryImpl.JavaType
- All Implemented Interfaces:
RelDataType
,RelDataTypeFamily
- Enclosing class:
RelDataTypeFactoryImpl
Type which is based upon a Java class.
-
Field Summary
Fields inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
digest, fieldList, NON_NULLABLE_SUFFIX
Fields inherited from interface org.apache.calcite.rel.type.RelDataType
PRECISION_NOT_SPECIFIED, SCALE_NOT_SPECIFIED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
generateTypeString
(StringBuilder sb, boolean withDetail) Generates a string representation of this type.@Nullable Charset
Gets this type's character set, or null if this type cannot carry a character set or has no character set defined.@Nullable SqlCollation
Gets this type's collation, or null if this type cannot carry a collation or has no collation defined.@Nullable RelDataType
Gets the component type if this type is a collection, otherwise null.Gets a canonical object representing the family of this type.@Nullable RelDataType
ForRelDataTypeFactoryImpl.JavaType
created withMap
class, we cannot get the key type.Gets theSqlTypeName
of this type.@Nullable RelDataType
ForRelDataTypeFactoryImpl.JavaType
created withMap
class, we cannot get the value type.boolean
Queries whether this type allows null values.Methods inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
computeDigest, equals, extra, getComparability, getField, getFieldCount, getFieldList, getFieldMap, getFieldNames, getFullTypeString, getIntervalQualifier, getPrecedenceList, getPrecision, getScale, getSqlIdentifier, getStructKind, hashCode, isDynamicStruct, isStruct, proto, proto, proto, proto, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.type.RelDataType
equalsSansFieldNames, equalsSansFieldNamesAndNullability, getMeasureElementType, isMeasure
-
Constructor Details
-
JavaType
-
JavaType
-
JavaType
public JavaType(Class clazz, boolean nullable, @Nullable Charset charset, @Nullable SqlCollation collation)
-
-
Method Details
-
getJavaClass
-
isNullable
public boolean isNullable()Description copied from interface:RelDataType
Queries whether this type allows null values.- Specified by:
isNullable
in interfaceRelDataType
- Overrides:
isNullable
in classRelDataTypeImpl
- Returns:
- whether type allows null values
-
getFamily
Description copied from interface:RelDataType
Gets a canonical object representing the family of this type. Two values can be compared if and only if their types are in the same family.- Specified by:
getFamily
in interfaceRelDataType
- Overrides:
getFamily
in classRelDataTypeImpl
- Returns:
- canonical object representing type family, never null
-
generateTypeString
Description copied from class:RelDataTypeImpl
Generates a string representation of this type.- Specified by:
generateTypeString
in classRelDataTypeImpl
- Parameters:
sb
- StringBuilder into which to generate the stringwithDetail
- when true, all detail information needed to compute a unique digest (and return from getFullTypeString) should be included;
-
getComponentType
Description copied from interface:RelDataType
Gets the component type if this type is a collection, otherwise null.- Specified by:
getComponentType
in interfaceRelDataType
- Overrides:
getComponentType
in classRelDataTypeImpl
- Returns:
- canonical type descriptor for components
-
getKeyType
ForRelDataTypeFactoryImpl.JavaType
created withMap
class, we cannot get the key type. Use ANY as key type.- Specified by:
getKeyType
in interfaceRelDataType
- Overrides:
getKeyType
in classRelDataTypeImpl
- Returns:
- canonical type descriptor for key
-
getValueType
ForRelDataTypeFactoryImpl.JavaType
created withMap
class, we cannot get the value type. Use ANY as value type.- Specified by:
getValueType
in interfaceRelDataType
- Overrides:
getValueType
in classRelDataTypeImpl
- Returns:
- canonical type descriptor for value
-
getCharset
Description copied from interface:RelDataType
Gets this type's character set, or null if this type cannot carry a character set or has no character set defined.- Specified by:
getCharset
in interfaceRelDataType
- Overrides:
getCharset
in classRelDataTypeImpl
- Returns:
- charset of type
-
getCollation
Description copied from interface:RelDataType
Gets this type's collation, or null if this type cannot carry a collation or has no collation defined.- Specified by:
getCollation
in interfaceRelDataType
- Overrides:
getCollation
in classRelDataTypeImpl
- Returns:
- collation of type
-
getSqlTypeName
Description copied from class:RelDataTypeImpl
Gets theSqlTypeName
of this type. Sub-classes must override the method to ensure the resulting value is non-nullable.- Specified by:
getSqlTypeName
in interfaceRelDataType
- Overrides:
getSqlTypeName
in classRelDataTypeImpl
- Returns:
- SqlTypeName, never null
-