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_SUFFIXFields inherited from interface org.apache.calcite.rel.type.RelDataType
PRECISION_NOT_SPECIFIED, SCALE_NOT_SPECIFIED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgenerateTypeString(StringBuilder sb, boolean withDetail) Generates a string representation of this type.@Nullable CharsetGets this type's character set, or null if this type cannot carry a character set or has no character set defined.@Nullable SqlCollationGets this type's collation, or null if this type cannot carry a collation or has no collation defined.@Nullable RelDataTypeGets the component type if this type is a collection, otherwise null.Gets a canonical object representing the family of this type.@Nullable RelDataTypeForRelDataTypeFactoryImpl.JavaTypecreated withMapclass, we cannot get the key type.Gets theSqlTypeNameof this type.@Nullable RelDataTypeForRelDataTypeFactoryImpl.JavaTypecreated withMapclass, we cannot get the value type.booleanQueries 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:RelDataTypeQueries whether this type allows null values.- Specified by:
isNullablein interfaceRelDataType- Overrides:
isNullablein classRelDataTypeImpl- Returns:
- whether type allows null values
-
getFamily
Description copied from interface:RelDataTypeGets 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:
getFamilyin interfaceRelDataType- Overrides:
getFamilyin classRelDataTypeImpl- Returns:
- canonical object representing type family, never null
-
generateTypeString
Description copied from class:RelDataTypeImplGenerates a string representation of this type.- Specified by:
generateTypeStringin 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:RelDataTypeGets the component type if this type is a collection, otherwise null.- Specified by:
getComponentTypein interfaceRelDataType- Overrides:
getComponentTypein classRelDataTypeImpl- Returns:
- canonical type descriptor for components
-
getKeyType
ForRelDataTypeFactoryImpl.JavaTypecreated withMapclass, we cannot get the key type. Use ANY as key type.- Specified by:
getKeyTypein interfaceRelDataType- Overrides:
getKeyTypein classRelDataTypeImpl- Returns:
- canonical type descriptor for key
-
getValueType
ForRelDataTypeFactoryImpl.JavaTypecreated withMapclass, we cannot get the value type. Use ANY as value type.- Specified by:
getValueTypein interfaceRelDataType- Overrides:
getValueTypein classRelDataTypeImpl- Returns:
- canonical type descriptor for value
-
getCharset
Description copied from interface:RelDataTypeGets this type's character set, or null if this type cannot carry a character set or has no character set defined.- Specified by:
getCharsetin interfaceRelDataType- Overrides:
getCharsetin classRelDataTypeImpl- Returns:
- charset of type
-
getCollation
Description copied from interface:RelDataTypeGets this type's collation, or null if this type cannot carry a collation or has no collation defined.- Specified by:
getCollationin interfaceRelDataType- Overrides:
getCollationin classRelDataTypeImpl- Returns:
- collation of type
-
getSqlTypeName
Description copied from class:RelDataTypeImplGets theSqlTypeNameof this type. Sub-classes must override the method to ensure the resulting value is non-nullable.- Specified by:
getSqlTypeNamein interfaceRelDataType- Overrides:
getSqlTypeNamein classRelDataTypeImpl- Returns:
- SqlTypeName, never null
-