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 |
|---|---|
Charset |
getCharset()
Gets this type's character set, or null if this type cannot carry a
character set or has no character set defined.
|
SqlCollation |
getCollation()
Gets this type's collation, or null if this type cannot carry a collation
or has no collation defined.
|
RelDataTypeComparability |
getComparability() |
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.
|
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.
|
SqlIntervalQualifier |
getIntervalQualifier()
Gets this type's interval qualifier, or null if this is not an interval
type.
|
RelDataType |
getKeyType()
Gets the key type if this type is a map, otherwise null.
|
RelDataTypePrecedenceList |
getPrecedenceList() |
int |
getPrecision()
Gets the JDBC-defined precision for values of this type.
|
int |
getScale()
Gets the scale of this type.
|
SqlIdentifier |
getSqlIdentifier()
Gets the
SqlIdentifier associated with this type. |
SqlTypeName |
getSqlTypeName()
Gets the
SqlTypeName of this type. |
RelDataType |
getValueType()
Gets the value type if this type is a map, otherwise null.
|
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
boolean isStruct()
List<RelDataTypeField> getFieldList()
List<String> getFieldNames()
int getFieldCount()
This method is equivalent to .getFieldList()
().size()
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 recordsboolean isNullable()
RelDataType getComponentType()
RelDataType getKeyType()
RelDataType getValueType()
Charset getCharset()
SqlCollation getCollation()
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.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()
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.