Package org.apache.calcite.sql.type
Class ObjectSqlType
- java.lang.Object
-
- org.apache.calcite.rel.type.RelDataTypeImpl
-
- org.apache.calcite.sql.type.AbstractSqlType
-
- org.apache.calcite.sql.type.ObjectSqlType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,RelDataType
,RelDataTypeFamily
public class ObjectSqlType extends AbstractSqlType
ObjectSqlType represents an SQL structured user-defined type.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private RelDataTypeComparability
comparability
private RelDataTypeFamily
family
private SqlIdentifier
sqlIdentifier
-
Fields inherited from class org.apache.calcite.sql.type.AbstractSqlType
isNullable, 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 Constructor Description ObjectSqlType(SqlTypeName typeName, SqlIdentifier sqlIdentifier, boolean nullable, java.util.List<? extends RelDataTypeField> fields, RelDataTypeComparability comparability)
Constructs an object type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
generateTypeString(java.lang.StringBuilder sb, boolean withDetail)
Generates a string representation of this type.RelDataTypeComparability
getComparability()
RelDataTypeFamily
getFamily()
Gets a canonical object representing the family of this type.SqlIdentifier
getSqlIdentifier()
Gets theSqlIdentifier
associated with this type.void
setFamily(RelDataTypeFamily family)
-
Methods inherited from class org.apache.calcite.sql.type.AbstractSqlType
getPrecedenceList, getSqlTypeName, isNullable
-
Methods inherited from class org.apache.calcite.rel.type.RelDataTypeImpl
computeDigest, equals, extra, getCharset, getCollation, getComponentType, getField, getFieldCount, getFieldList, getFieldNames, getFullTypeString, getIntervalQualifier, getKeyType, getPrecision, getScale, getStructKind, getValueType, hashCode, isDynamicStruct, isStruct, proto, proto, proto, proto, toString
-
-
-
-
Field Detail
-
sqlIdentifier
private final SqlIdentifier sqlIdentifier
-
comparability
private final RelDataTypeComparability comparability
-
family
private RelDataTypeFamily family
-
-
Constructor Detail
-
ObjectSqlType
public ObjectSqlType(SqlTypeName typeName, SqlIdentifier sqlIdentifier, boolean nullable, java.util.List<? extends RelDataTypeField> fields, RelDataTypeComparability comparability)
Constructs an object type. This should only be called from a factory method.- Parameters:
typeName
- SqlTypeName for this type (either Distinct or Structured)sqlIdentifier
- identifier for this typenullable
- whether type accepts nullsfields
- object attribute definitions
-
-
Method Detail
-
setFamily
public void setFamily(RelDataTypeFamily family)
-
getComparability
public RelDataTypeComparability getComparability()
- Specified by:
getComparability
in interfaceRelDataType
- Overrides:
getComparability
in classRelDataTypeImpl
- Returns:
- the category of comparison operators which make sense when applied to values of this type
-
getSqlIdentifier
public SqlIdentifier getSqlIdentifier()
Description copied from interface:RelDataType
Gets theSqlIdentifier
associated with this type. For a predefined type, this is a simple identifier based onRelDataType.getSqlTypeName()
. For a user-defined type, this is a compound identifier which uniquely names the type.- Specified by:
getSqlIdentifier
in interfaceRelDataType
- Overrides:
getSqlIdentifier
in classRelDataTypeImpl
- Returns:
- SqlIdentifier, or null if this is not an SQL type
-
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 classAbstractSqlType
- Returns:
- canonical object representing type family
-
generateTypeString
protected void generateTypeString(java.lang.StringBuilder sb, boolean withDetail)
Description copied from class:RelDataTypeImpl
Generates a string representation of this type.- Specified by:
generateTypeString
in classRelDataTypeImpl
- Parameters:
sb
- StringBuffer into which to generate the stringwithDetail
- when true, all detail information needed to compute a unique digest (and return from getFullTypeString) should be included;
-
-