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:
java.io.Serializable
,java.lang.Cloneable
,RelDataType
,RelDataTypeFamily
- Direct Known Subclasses:
ArraySqlType
,BasicSqlType
,IntervalSqlType
,MapSqlType
,MultisetSqlType
,ObjectSqlType
public abstract class AbstractSqlType extends RelDataTypeImpl implements java.lang.Cloneable, java.io.Serializable
Abstract base class for SQL implementations ofRelDataType
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
isNullable
protected SqlTypeName
typeName
-
Fields inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
digest, fieldList
-
Fields inherited from interface org.apache.calcite.rel.type.RelDataType
PRECISION_NOT_SPECIFIED, SCALE_NOT_SPECIFIED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSqlType(SqlTypeName typeName, boolean isNullable, java.util.List<? extends RelDataTypeField> fields)
Creates an AbstractSqlType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelDataTypeFamily
getFamily()
Gets a canonical object representing the family of this type.RelDataTypePrecedenceList
getPrecedenceList()
SqlTypeName
getSqlTypeName()
Gets theSqlTypeName
of this type.boolean
isNullable()
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, getFieldNames, getFullTypeString, getIntervalQualifier, getKeyType, getPrecision, getScale, getSqlIdentifier, getStructKind, getValueType, hashCode, isDynamicStruct, isStruct, proto, proto, proto, proto, toString
-
-
-
-
Field Detail
-
typeName
protected final SqlTypeName typeName
-
isNullable
protected boolean isNullable
-
-
Constructor Detail
-
AbstractSqlType
protected AbstractSqlType(SqlTypeName typeName, boolean isNullable, java.util.List<? extends RelDataTypeField> fields)
Creates an AbstractSqlType.- Parameters:
typeName
- Type nameisNullable
- Whether nullablefields
- Fields of type, or null if not a record type
-
-
Method Detail
-
getSqlTypeName
public SqlTypeName getSqlTypeName()
Description copied from interface:RelDataType
Gets theSqlTypeName
of this type.- Specified by:
getSqlTypeName
in interfaceRelDataType
- Overrides:
getSqlTypeName
in classRelDataTypeImpl
- Returns:
- SqlTypeName, or null if this is not an SQL predefined type
-
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
public RelDataTypeFamily 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
-
getPrecedenceList
public RelDataTypePrecedenceList getPrecedenceList()
- Specified by:
getPrecedenceList
in interfaceRelDataType
- Overrides:
getPrecedenceList
in classRelDataTypeImpl
- Returns:
- precedence list for this type
-
-