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
FieldsFields 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
ConstructorsModifierConstructorDescriptionprotectedAbstractSqlType(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 theSqlTypeNameof this type.booleanQueries 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, 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
-
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: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
-
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
-
getPrecedenceList
Description copied from interface:RelDataTypeReturns the precedence list for this type.- Specified by:
getPrecedenceListin interfaceRelDataType- Overrides:
getPrecedenceListin classRelDataTypeImpl
-