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, typeNameFields 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
ConstructorsConstructorDescriptionObjectSqlType(SqlTypeName typeName, @Nullable SqlIdentifier sqlIdentifier, boolean nullable, List<? extends RelDataTypeField> fields, RelDataTypeComparability comparability) Constructs an object type. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgenerateTypeString(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 SqlIdentifierGets theSqlIdentifierassociated with this type.voidsetFamily(RelDataTypeFamily family) Methods inherited from class org.apache.calcite.sql.type.AbstractSqlType
getPrecedenceList, getSqlTypeName, isNullableMethods 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, 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
-
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:RelDataTypeReturns the category of comparison operators that make sense when applied to values of this type.- Specified by:
getComparabilityin interfaceRelDataType- Overrides:
getComparabilityin classRelDataTypeImpl
-
getSqlIdentifier
Description copied from interface:RelDataTypeGets theSqlIdentifierassociated 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:
getSqlIdentifierin interfaceRelDataType- Overrides:
getSqlIdentifierin classRelDataTypeImpl- Returns:
- SqlIdentifier, or null if this is not an SQL type
-
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 classAbstractSqlType- Returns:
- canonical object representing type family, never null
-
generateTypeString
Description copied from class:RelDataTypeImplGenerates a string representation of this type.- Specified by:
generateTypeStringin 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;
-