|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.reltype.RelDataTypeFactoryImpl org.eigenbase.sql.type.SqlTypeFactoryImpl
public class SqlTypeFactoryImpl
SqlTypeFactoryImpl provides a default implementation of RelDataTypeFactory
which supports SQL types.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eigenbase.reltype.RelDataTypeFactoryImpl |
---|
RelDataTypeFactoryImpl.JavaType |
Nested classes/interfaces inherited from interface org.eigenbase.reltype.RelDataTypeFactory |
---|
RelDataTypeFactory.FieldInfo, RelDataTypeFactory.ListFieldInfo |
Constructor Summary | |
---|---|
SqlTypeFactoryImpl()
|
Method Summary | |
---|---|
private void |
assertBasic(SqlTypeName typeName)
|
protected RelDataType |
canonize(RelDataType type)
Registers a type, or returns the existing type if it is already registered. |
private RelDataType |
copyIntervalType(RelDataType type,
boolean nullable)
|
private RelDataType |
copyMultisetType(RelDataType type,
boolean nullable)
|
private RelDataType |
copyObjectType(RelDataType type,
boolean nullable)
|
private RelDataType |
createDoublePrecisionType()
|
RelDataType |
createMultisetType(RelDataType type,
long maxCardinality)
Creates a multiset type. |
RelDataType |
createSqlIntervalType(SqlIntervalQualifier intervalQualifier)
Creates a SQL interval type. |
RelDataType |
createSqlType(SqlTypeName typeName)
Creates a SQL type with no precision or scale. |
RelDataType |
createSqlType(SqlTypeName typeName,
int precision)
Creates a SQL type with length (precision) but no scale. |
RelDataType |
createSqlType(SqlTypeName typeName,
int precision,
int scale)
Creates a SQL type with precision and scale. |
RelDataType |
createTypeWithCharsetAndCollation(RelDataType type,
Charset charset,
SqlCollation collation)
Creates a Type which is the same as another type but with possibily different charset or collation. |
RelDataType |
createTypeWithNullability(RelDataType type,
boolean nullable)
Creates a type which is the same as another type but with possibly different nullability. |
RelDataType |
leastRestrictive(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. |
private RelDataType |
leastRestrictiveByCast(RelDataType[] types)
|
private RelDataType |
leastRestrictiveSqlType(RelDataType[] types)
|
protected boolean |
shouldRaggedFixedLengthValueUnionBeVariable()
Controls behavior discussed here. |
Methods inherited from class org.eigenbase.reltype.RelDataTypeFactoryImpl |
---|
copyType, createArrayType, createDecimalProduct, createDecimalQuotient, createJavaType, createJoinType, createStructType, createStructType, createStructType, getDefaultCharset, isJavaType, leastRestrictiveStructuredType, useDoubleMultiplication |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SqlTypeFactoryImpl()
Method Detail |
---|
public RelDataType createSqlType(SqlTypeName typeName)
RelDataTypeFactory
typeName
- Name of the type, for example SqlTypeName.BOOLEAN
.
public RelDataType createSqlType(SqlTypeName typeName, int precision)
RelDataTypeFactory
typeName
- Name of the type, for example SqlTypeName.VARCHAR
.precision
- maximum length of the value (non-numeric types) or the
precision of the value (numeric/datetime types) requires both operands to
have exact numeric types.
public RelDataType createSqlType(SqlTypeName typeName, int precision, int scale)
RelDataTypeFactory
typeName
- Name of the type, for example SqlTypeName.DECIMAL
.precision
- precision of the valuescale
- scale of the values, i.e. the number of decimal places to
shift the value. For example, a NUMBER(10,3) value of "123.45" is
represented "123450" (that is, multiplied by 10^3). A negative scale
is valid.
public RelDataType createMultisetType(RelDataType type, long maxCardinality)
RelDataTypeFactory
type
- type of the elements of the multisetmaxCardinality
- maximum collection size, or -1 for unlimited
public RelDataType createSqlIntervalType(SqlIntervalQualifier intervalQualifier)
RelDataTypeFactory
intervalQualifier
- contains information if it is a year-month or a
day-time interval along with precision information
public RelDataType createTypeWithCharsetAndCollation(RelDataType type, Charset charset, SqlCollation collation)
RelDataTypeFactory
type
- input typecharset
- charset to assigncollation
- collation to assign
public RelDataType leastRestrictive(RelDataType[] types)
RelDataTypeFactory
leastRestrictive
in interface RelDataTypeFactory
leastRestrictive
in class RelDataTypeFactoryImpl
types
- input types to be unioned
private RelDataType leastRestrictiveByCast(RelDataType[] types)
public RelDataType createTypeWithNullability(RelDataType type, boolean nullable)
RelDataTypeFactory
createTypeWithNullability
in interface RelDataTypeFactory
createTypeWithNullability
in class RelDataTypeFactoryImpl
type
- input typenullable
- true to request a nullable type; false to request a NOT
NULL type
private void assertBasic(SqlTypeName typeName)
private RelDataType leastRestrictiveSqlType(RelDataType[] types)
protected boolean shouldRaggedFixedLengthValueUnionBeVariable()
private RelDataType createDoublePrecisionType()
private RelDataType copyMultisetType(RelDataType type, boolean nullable)
private RelDataType copyIntervalType(RelDataType type, boolean nullable)
private RelDataType copyObjectType(RelDataType type, boolean nullable)
protected RelDataType canonize(RelDataType type)
RelDataTypeFactoryImpl
canonize
in class RelDataTypeFactoryImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |