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:
Serializable
,Cloneable
,RelDataType
,RelDataTypeFamily
ObjectSqlType represents an SQL structured user-defined type.
- See Also:
-
Field Summary
Fields inherited from class org.apache.calcite.sql.type.AbstractSqlType
isNullable, typeName
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
ConstructorDescriptionObjectSqlType
(SqlTypeName typeName, @Nullable SqlIdentifier sqlIdentifier, boolean nullable, List<? extends RelDataTypeField> fields, RelDataTypeComparability comparability) Constructs an object type. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
generateTypeString
(StringBuilder sb, boolean withDetail) Generates a string representation of this type.Returns the category of comparison operators that make sense when applied to values of this type.Gets a canonical object representing the family of this type.@Nullable SqlIdentifier
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, getFieldMap, getFieldNames, getFullTypeString, getIntervalQualifier, getKeyType, getPrecision, getScale, 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
-
Constructor Details
-
ObjectSqlType
public ObjectSqlType(SqlTypeName typeName, @Nullable SqlIdentifier sqlIdentifier, boolean nullable, 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 Details
-
setFamily
-
getComparability
Description copied from interface:RelDataType
Returns the category of comparison operators that make sense when applied to values of this type.- Specified by:
getComparability
in interfaceRelDataType
- Overrides:
getComparability
in classRelDataTypeImpl
-
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
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, never null
-
generateTypeString
Description copied from class:RelDataTypeImpl
Generates a string representation of this type.- Specified by:
generateTypeString
in 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;
-