public abstract class RelDataTypeFactoryImpl extends Object implements RelDataTypeFactory
RelDataTypeFactory.| Modifier and Type | Class and Description |
|---|---|
class |
RelDataTypeFactoryImpl.JavaType
Type which is based upon a Java class.
|
RelDataTypeFactory.Builder, RelDataTypeFactory.FieldInfo, RelDataTypeFactory.FieldInfoBuilder| Modifier and Type | Field and Description |
|---|---|
protected RelDataTypeSystem |
typeSystem |
| Modifier | Constructor and Description |
|---|---|
protected |
RelDataTypeFactoryImpl(RelDataTypeSystem typeSystem)
Creates a type factory.
|
| Modifier and Type | Method and Description |
|---|---|
RelDataTypeFactory.FieldInfoBuilder |
builder()
Creates a
RelDataTypeFactory.FieldInfoBuilder. |
protected RelDataType |
canonize(RelDataType type)
Registers a type, or returns the existing type if it is already
registered.
|
protected RelDataType |
canonize(StructKind kind,
List<String> names,
List<RelDataType> types) |
protected RelDataType |
canonize(StructKind kind,
List<String> names,
List<RelDataType> types,
boolean nullable)
Looks up a type using a temporary key, and if not present, creates
a permanent key and type.
|
RelDataType |
copyType(RelDataType type)
Duplicates a type, making a deep copy.
|
@Nullable RelDataType |
createDecimalProduct(RelDataType type1,
RelDataType type2)
Deprecated.
|
@Nullable RelDataType |
createDecimalQuotient(RelDataType type1,
RelDataType type2)
Deprecated.
|
RelDataType |
createJavaType(Class clazz)
Creates a type that corresponds to a Java class.
|
RelDataType |
createJoinType(RelDataType... types)
Creates a cartesian product type.
|
RelDataType |
createStructType(List<? extends Map.Entry<String,RelDataType>> fieldList)
Creates a type that represents a structured collection of fieldList,
obtaining the field information from a list of (name, type) pairs.
|
RelDataType |
createStructType(List<RelDataType> typeList,
List<String> fieldNameList)
Creates a type that represents a structured collection of fields.
|
RelDataType |
createStructType(RelDataTypeFactory.FieldInfo fieldInfo)
Creates a type that represents a structured collection of fields,
obtaining the field information via a callback.
|
RelDataType |
createStructType(StructKind kind,
List<RelDataType> typeList,
List<String> fieldNameList)
Creates a type that represents a structured collection of fields, given
lists of the names and types of the fields.
|
RelDataType |
createTypeWithNullability(RelDataType type,
boolean nullable)
Creates a type that is the same as another type but with possibly
different nullability.
|
RelDataType |
decimalOf(RelDataType type)
Create a decimal type equivalent to the numeric
type,
this is related to specific system implementation,
you can override this logic if it is required. |
Charset |
getDefaultCharset()
Returns the default
Charset (valid if this is a string type). |
RelDataTypeSystem |
getTypeSystem()
Returns the type system.
|
static boolean |
isJavaType(RelDataType t) |
@Nullable RelDataType |
leastRestrictive(List<RelDataType> types)
Returns the most general of a set of types (that is, one type to which
they can all be cast), or null if conversion is not possible.
|
protected @Nullable RelDataType |
leastRestrictiveArrayMultisetType(List<RelDataType> types,
SqlTypeName sqlTypeName) |
protected @Nullable RelDataType |
leastRestrictiveMapType(List<RelDataType> types,
SqlTypeName sqlTypeName) |
protected @Nullable RelDataType |
leastRestrictiveStructuredType(List<RelDataType> types) |
boolean |
useDoubleMultiplication(RelDataType type1,
RelDataType type2)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateArrayType, createMapType, createMultisetType, createSqlIntervalType, createSqlType, createSqlType, createSqlType, createTypeWithCharsetAndCollation, createUnknownTypeprotected final RelDataTypeSystem typeSystem
protected RelDataTypeFactoryImpl(RelDataTypeSystem typeSystem)
public RelDataTypeSystem getTypeSystem()
RelDataTypeFactorygetTypeSystem in interface RelDataTypeFactorypublic RelDataType createJavaType(Class clazz)
RelDataTypeFactorycreateJavaType in interface RelDataTypeFactoryclazz - the Java class used to define the typepublic RelDataType createJoinType(RelDataType... types)
RelDataTypeFactorycreateJoinType in interface RelDataTypeFactorytypes - array of types to be joinedpublic RelDataType createStructType(List<RelDataType> typeList, List<String> fieldNameList)
RelDataTypeFactorycreateStructType(StructKind.FULLY_QUALIFIED, typeList,
fieldNameList).createStructType in interface RelDataTypeFactorypublic RelDataType createStructType(StructKind kind, List<RelDataType> typeList, List<String> fieldNameList)
RelDataTypeFactorycreateStructType in interface RelDataTypeFactorykind - Name resolution policytypeList - types of the fieldsfieldNameList - names of the fieldspublic RelDataType createStructType(RelDataTypeFactory.FieldInfo fieldInfo)
RelDataTypeFactorycreateStructType in interface RelDataTypeFactoryfieldInfo - callback for field informationpublic final RelDataType createStructType(List<? extends Map.Entry<String,RelDataType>> fieldList)
RelDataTypeFactorycreateStructType in interface RelDataTypeFactoryfieldList - List of (name, type) pairspublic @Nullable RelDataType leastRestrictive(List<RelDataType> types)
RelDataTypeFactoryleastRestrictive(INT, NUMERIC(3, 2)) could be
NUMERIC(12, 2).leastRestrictive in interface RelDataTypeFactorytypes - input types to be combined using union (not null, not empty)protected @Nullable RelDataType leastRestrictiveStructuredType(List<RelDataType> types)
protected @Nullable RelDataType leastRestrictiveArrayMultisetType(List<RelDataType> types, SqlTypeName sqlTypeName)
protected @Nullable RelDataType leastRestrictiveMapType(List<RelDataType> types, SqlTypeName sqlTypeName)
public RelDataType copyType(RelDataType type)
RelDataTypeFactorycopyType in interface RelDataTypeFactorytype - input typepublic RelDataType createTypeWithNullability(RelDataType type, boolean nullable)
RelDataTypeFactorycreateTypeWithNullability in interface RelDataTypeFactorytype - input typenullable - true to request a nullable type; false to request a NOT
NULL typeprotected RelDataType canonize(RelDataType type)
NullPointerException - if type is nullprotected RelDataType canonize(StructKind kind, List<String> names, List<RelDataType> types, boolean nullable)
This approach allows us to use a cheap temporary key. A permanent key is more expensive, because it must be immutable and not hold references into other data structures.
protected RelDataType canonize(StructKind kind, List<String> names, List<RelDataType> types)
public static boolean isJavaType(RelDataType t)
@Deprecated public @Nullable RelDataType createDecimalProduct(RelDataType type1, RelDataType type2)
RelDataTypeSystem.deriveDecimalMultiplyType(RelDataTypeFactory, RelDataType, RelDataType)
to get the return type for the operation.createDecimalProduct in interface RelDataTypeFactorytype1 - type of the first operandtype2 - type of the second operand@Deprecated public boolean useDoubleMultiplication(RelDataType type1, RelDataType type2)
RelDataTypeSystem.shouldUseDoubleMultiplication(RelDataTypeFactory, RelDataType, RelDataType)
to get if double should be used for multiplication.useDoubleMultiplication in interface RelDataTypeFactory@Deprecated public @Nullable RelDataType createDecimalQuotient(RelDataType type1, RelDataType type2)
RelDataTypeSystem.deriveDecimalDivideType(RelDataTypeFactory, RelDataType, RelDataType)
to get the return type for the operation.createDecimalQuotient in interface RelDataTypeFactorytype1 - type of the first operandtype2 - type of the second operandpublic RelDataType decimalOf(RelDataType type)
RelDataTypeFactorytype,
this is related to specific system implementation,
you can override this logic if it is required.decimalOf in interface RelDataTypeFactorytype - the numeric type to create decimal type withpublic Charset getDefaultCharset()
RelDataTypeFactoryCharset (valid if this is a string type).getDefaultCharset in interface RelDataTypeFactorypublic RelDataTypeFactory.FieldInfoBuilder builder()
RelDataTypeFactoryRelDataTypeFactory.FieldInfoBuilder.
But since FieldInfoBuilder is deprecated, we recommend that you use
its base class RelDataTypeFactory.Builder, which is not deprecated.builder in interface RelDataTypeFactoryCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.