Package org.apache.calcite.sql.type
Class MapSqlType
- java.lang.Object
-
- org.apache.calcite.rel.type.RelDataTypeImpl
-
- org.apache.calcite.sql.type.AbstractSqlType
-
- org.apache.calcite.sql.type.MapSqlType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,RelDataType
,RelDataTypeFamily
public class MapSqlType extends AbstractSqlType
SQL map type.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private RelDataType
keyType
private RelDataType
valueType
-
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 MapSqlType(RelDataType keyType, RelDataType valueType, boolean isNullable)
Creates a MapSqlType.
-
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.RelDataTypeFamily
getFamily()
Gets a canonical object representing the family of this type.RelDataType
getKeyType()
Gets the key type if this type is a map, otherwise null.RelDataType
getValueType()
Gets the value type if this type is a map, otherwise null.-
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, getComparability, getComponentType, getField, getFieldCount, getFieldList, getFieldNames, getFullTypeString, getIntervalQualifier, getPrecision, getScale, getSqlIdentifier, getStructKind, hashCode, isDynamicStruct, isStruct, proto, proto, proto, proto, toString
-
-
-
-
Field Detail
-
keyType
private final RelDataType keyType
-
valueType
private final RelDataType valueType
-
-
Constructor Detail
-
MapSqlType
public MapSqlType(RelDataType keyType, RelDataType valueType, boolean isNullable)
Creates a MapSqlType. This constructor should only be called from a factory method.
-
-
Method Detail
-
getValueType
public RelDataType getValueType()
Description copied from interface:RelDataType
Gets the value type if this type is a map, otherwise null.- Specified by:
getValueType
in interfaceRelDataType
- Overrides:
getValueType
in classRelDataTypeImpl
- Returns:
- canonical type descriptor for value
-
getKeyType
public RelDataType getKeyType()
Description copied from interface:RelDataType
Gets the key type if this type is a map, otherwise null.- Specified by:
getKeyType
in interfaceRelDataType
- Overrides:
getKeyType
in classRelDataTypeImpl
- Returns:
- canonical type descriptor for key
-
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;
-
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
-
-