Package org.apache.calcite.sql.type
Class AbstractSqlType
java.lang.Object
org.apache.calcite.rel.type.RelDataTypeImpl
org.apache.calcite.sql.type.AbstractSqlType
- All Implemented Interfaces:
Serializable
,Cloneable
,RelDataType
,RelDataTypeFamily
- Direct Known Subclasses:
ArraySqlType
,BasicSqlType
,FunctionSqlType
,IntervalSqlType
,MapSqlType
,MeasureSqlType
,MultisetSqlType
,ObjectSqlType
Abstract base class for SQL implementations of
RelDataType
.- See Also:
-
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
ModifierConstructorDescriptionprotected
AbstractSqlType
(SqlTypeName typeName, boolean isNullable, @Nullable List<? extends RelDataTypeField> fields) Creates an AbstractSqlType. -
Method Summary
Modifier and TypeMethodDescriptionGets a canonical object representing the family of this type.Returns the precedence list for this type.Gets theSqlTypeName
of this type.boolean
Queries whether this type allows null values.Methods inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
computeDigest, equals, extra, generateTypeString, getCharset, getCollation, getComparability, getComponentType, getField, getFieldCount, getFieldList, getFieldMap, getFieldNames, getFullTypeString, getIntervalQualifier, getKeyType, getPrecision, getScale, getSqlIdentifier, getStructKind, getValueType, 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
-
Field Details
-
typeName
-
isNullable
protected final boolean isNullable
-
-
Constructor Details
-
AbstractSqlType
protected AbstractSqlType(SqlTypeName typeName, boolean isNullable, @Nullable List<? extends RelDataTypeField> fields) Creates an AbstractSqlType.- Parameters:
typeName
- Type nameisNullable
- Whether nullablefields
- Fields of type, or null if not a record type
-
-
Method Details
-
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
-
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
-
getPrecedenceList
Description copied from interface:RelDataType
Returns the precedence list for this type.- Specified by:
getPrecedenceList
in interfaceRelDataType
- Overrides:
getPrecedenceList
in classRelDataTypeImpl
-