public interface RelDataType
This is a somewhat "fat" interface which unions the attributes of many different type classes into one. Inelegant, but since our type system was defined before the advent of Java generics, it avoids a lot of typecasting.
| Modifier and Type | Field and Description |
|---|---|
static int |
PRECISION_NOT_SPECIFIED |
static int |
SCALE_NOT_SPECIFIED |
| Modifier and Type | Method and Description |
|---|---|
default boolean |
equalsSansFieldNames(@Nullable RelDataType that)
Returns whether the field types are equal with each other by ignoring the
field names.
|
@Nullable Charset |
getCharset()
Gets this type's character set, or null if this type cannot carry a
character set or has no character set defined.
|
@Nullable SqlCollation |
getCollation()
Gets this type's collation, or null if this type cannot carry a collation
or has no collation defined.
|
RelDataTypeComparability |
getComparability()
Returns the category of comparison operators that make sense when applied
to values of this type.
|
@Nullable RelDataType |
getComponentType()
Gets the component type if this type is a collection, otherwise null.
|
RelDataTypeFamily |
getFamily()
Gets a canonical object representing the family of this type.
|
@Nullable RelDataTypeField |
getField(String fieldName,
boolean caseSensitive,
boolean elideRecord)
Looks up a field by name.
|
int |
getFieldCount()
Returns the number of fields in a struct type.
|
List<RelDataTypeField> |
getFieldList()
Gets the fields in a struct type.
|
List<String> |
getFieldNames()
Returns the names of the fields in a struct type.
|
String |
getFullTypeString()
Gets a string representation of this type with full detail such as
character set and nullability.
|
@Nullable SqlIntervalQualifier |
getIntervalQualifier()
Gets this type's interval qualifier, or null if this is not an interval
type.
|
@Nullable RelDataType |
getKeyType()
Gets the key type if this type is a map, otherwise null.
|
RelDataTypePrecedenceList |
getPrecedenceList()
Returns the precedence list for this type.
|
int |
getPrecision()
Gets the JDBC-defined precision for values of this type.
|
int |
getScale()
Gets the scale of this type.
|
@Nullable SqlIdentifier |
getSqlIdentifier()
Gets the
SqlIdentifier associated with this type. |
SqlTypeName |
getSqlTypeName()
Gets the
SqlTypeName of this type. |
StructKind |
getStructKind()
Returns the rule for resolving the fields of a structured type,
or
StructKind.NONE if this is not a structured type. |
@Nullable RelDataType |
getValueType()
Gets the value type if this type is a map, otherwise null.
|
boolean |
isDynamicStruct()
Returns whether this type has dynamic structure (for "schema-on-read"
table).
|
boolean |
isNullable()
Queries whether this type allows null values.
|
boolean |
isStruct()
Queries whether this is a structured type.
|
String |
toString()
Gets a string representation of this type without detail such as
character set and nullability.
|
static final int SCALE_NOT_SPECIFIED
static final int PRECISION_NOT_SPECIFIED
@Pure boolean isStruct()
List<RelDataTypeField> getFieldList()
List<String> getFieldNames()
int getFieldCount()
This method is equivalent to
.getFieldList().size()
StructKind getStructKind()
StructKind.NONE if this is not a structured type.@Nullable RelDataTypeField getField(String fieldName, boolean caseSensitive, boolean elideRecord)
NOTE: Be careful choosing the value of caseSensitive:
true if you are sure that the field name is
internally generated.false is almost certainly wrong.fieldName - Name of field to findcaseSensitive - Whether match is case-sensitiveelideRecord - Whether to find fields nested within records@Pure boolean isNullable()
@Pure @Nullable RelDataType getComponentType()
@Nullable RelDataType getKeyType()
@Nullable RelDataType getValueType()
@Pure @Nullable Charset getCharset()
@Pure @Nullable SqlCollation getCollation()
@Pure @Nullable SqlIntervalQualifier getIntervalQualifier()
int getPrecision()
Returns PRECISION_NOT_SPECIFIED (-1) if precision is not
applicable for this type.
int getScale()
SCALE_NOT_SPECIFIED (-1) if
scale is not valid for this type.SqlTypeName getSqlTypeName()
SqlTypeName of this type.@Pure @Nullable SqlIdentifier getSqlIdentifier()
SqlIdentifier associated with this type. For a
predefined type, this is a simple identifier based on
getSqlTypeName(). For a user-defined type, this is a compound
identifier which uniquely names the type.String toString()
String getFullTypeString()
RelDataTypeFamily getFamily()
RelDataTypePrecedenceList getPrecedenceList()
RelDataTypeComparability getComparability()
boolean isDynamicStruct()
@API(since="1.24",
status=INTERNAL)
default boolean equalsSansFieldNames(@Nullable RelDataType that)
#equals(Object).Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.