|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.sql.type.SqlTypeStrategies
public abstract class SqlTypeStrategies
SqlTypeStrategies defines singleton instances of strategy objects for operand
type checking (member prefix otc
), operand type inference
(member prefix oti
), and operator return type inference (member
prefix rti
). For otc members, the convention
otcSometypeX2
means two operands of type Sometype
. The
convention otcSometypeLit
means a literal operand of type
Sometype
.
NOTE: avoid anonymous inner classes here except for unique, non-generalizable strategies; anything else belongs in a reusable top-level class. If you find yourself copying and pasting an existing strategy's anonymous inner class, you're making a mistake.
Field Summary | |
---|---|
static SqlSingleOperandTypeChecker |
otcAny
|
static SqlSingleOperandTypeChecker |
otcAnyX2
|
static SqlSingleOperandTypeChecker |
otcBinary
|
static SqlSingleOperandTypeChecker |
otcBool
|
static SqlSingleOperandTypeChecker |
otcBoolX2
|
static SqlSingleOperandTypeChecker |
otcCharString
|
static SqlOperandTypeChecker |
otcComparableOrdered
Operand type-checking strategy where operand type must allow ordered comparisons. |
static SqlOperandTypeChecker |
otcComparableOrderedX2
Operand type-checking strategy where operand types must allow ordered comparisons. |
static SqlOperandTypeChecker |
otcComparableUnorderedX2
Operand type-checking strategy where operand types must allow unordered comparisons. |
static SqlSingleOperandTypeChecker |
otcDatetime
|
static SqlSingleOperandTypeChecker |
otcDatetimeInterval
|
static SqlSingleOperandTypeChecker |
otcDatetimeOrInterval
|
static SqlSingleOperandTypeChecker |
otcDivisionOperator
Type checking strategy for the "/" operator |
static SqlSingleOperandTypeChecker |
otcExactNumeric
|
static SqlSingleOperandTypeChecker |
otcExactNumericX2
|
static SqlSingleOperandTypeChecker |
otcInterval
|
static SqlSingleOperandTypeChecker |
otcIntervalDatetime
|
static SqlSingleOperandTypeChecker |
otcIntervalNumeric
|
static SqlSingleOperandTypeChecker |
otcIntervalSameX2
Parameter type-checking strategy type must a nullable time interval, nullable time interval |
static SqlSingleOperandTypeChecker |
otcMinusDateOperator
|
static SqlSingleOperandTypeChecker |
otcMinusOperator
|
static SqlSingleOperandTypeChecker |
otcMultiplyOperator
Type checking strategy for the "*" operator |
static SqlSingleOperandTypeChecker |
otcMultiset
|
static SqlSingleOperandTypeChecker |
otcMultisetOrRecordTypeMultiset
|
static SqlOperandTypeChecker |
otcMultisetX2
|
static SqlSingleOperandTypeChecker |
otcNiladic
Operand type-checking strategy for an operator which takes no operands. |
static SqlSingleOperandTypeChecker |
otcNotNullLit
Operand type-checking strategy type must be a non-NULL literal. |
static SqlSingleOperandTypeChecker |
otcNullableLit
Operand type-checking strategy where type must be a literal or NULL. |
static SqlSingleOperandTypeChecker |
otcNumeric
|
static SqlSingleOperandTypeChecker |
otcNumericInterval
|
static SqlSingleOperandTypeChecker |
otcNumericOrInterval
|
static SqlSingleOperandTypeChecker |
otcNumericOrString
|
static SqlSingleOperandTypeChecker |
otcNumericX2
|
static SqlSingleOperandTypeChecker |
otcPlusOperator
|
static SqlSingleOperandTypeChecker |
otcPositiveIntLit
Operand type-checking strategy type must be a positive integer non-NULL literal. |
static SqlSingleOperandTypeChecker |
otcRecordMultiset
|
static SqlOperandTypeChecker |
otcRecordToScalarType
|
static SqlOperandTypeChecker |
otcSameVariadic
Operand type-checking strategy where any number of operands must all be in the same type family. |
static SqlOperandTypeChecker |
otcSameX2
Operand type-checking strategy where two operands must both be in the same type family. |
static SqlOperandTypeChecker |
otcSameX3
Operand type-checking strategy where three operands must all be in the same type family. |
static SqlOperandTypeChecker |
otcSetop
Operand type-checking strategy for a set operator (UNION, INTERSECT, EXCEPT). |
static SqlSingleOperandTypeChecker |
otcString
|
static SqlSingleOperandTypeChecker |
otcStringSameX2
Operand type-checking strategy where two operands must both be in the same string type family. |
static SqlSingleOperandTypeChecker |
otcStringSameX3
Operand type-checking strategy where three operands must all be in the same string type family. |
static SqlSingleOperandTypeChecker |
otcStringX2Int
|
static SqlSingleOperandTypeChecker |
otcStringX2IntX2
|
static SqlOperandTypeChecker |
otcVariadic
Operand type-checking strategy for an operator with no restrictions on number or type of operands. |
static SqlOperandTypeInference |
otiBoolean
Operand type-inference strategy where an unknown operand type is assumed to be boolean. |
static SqlOperandTypeInference |
otiFirstKnown
Operand type-inference strategy where an unknown operand type is derived from the first operand with a known type. |
static SqlOperandTypeInference |
otiReturnType
Operand type-inference strategy where an unknown operand type is derived from the call's return type. |
static SqlReturnTypeInference |
rtiAlwaysNullableBigint
Type-inference strategy whereby the result type of a call is a nullable Bigint |
static SqlReturnTypeInference |
rtiBigint
Type-inference strategy whereby the result type of a call is a Bigint |
static SqlReturnTypeInference |
rtiBoolean
Type-inference strategy whereby the result type of a call is Boolean. |
static SqlReturnTypeInference |
rtiColumnList
Type-inference strategy which always returns "COLUMN_LIST". |
static SqlReturnTypeInference |
rtiCursor
Type-inference strategy which always returns "CURSOR". |
static SqlReturnTypeInference |
rtiDate
Type-inference strategy whereby the result type of a call is Date. |
static SqlReturnTypeInference |
rtiDecimalNoScale
Type-inference strategy for a call where the first argument is a decimal. |
static SqlReturnTypeInference |
rtiDecimalProduct
Type-inference strategy whereby the result type of a call is the decimal product of two exact numeric operands where at least one of the operands is a decimal. |
static SqlReturnTypeInference |
rtiDecimalQuotient
Type-inference strategy whereby the result type of a call is the decimal product of two exact numeric operands where at least one of the operands is a decimal. |
static SqlReturnTypeInference |
rtiDecimalSum
Type-inference strategy whereby the result type of a call is the decimal sum of two exact numeric operands where at least one of the operands is a decimal. |
static SqlReturnTypeInference |
rtiDouble
Type-inference strategy whereby the result type of a call is Double. |
static SqlReturnTypeInference |
rtiDyadicStringSumPrecision
Type-inference strategy whereby the result type of a call is the same type as the input types but with the combined length of the two first types if types are of char type the type with the highest coercibility will be used result is varying if either input is; otherwise fixed Pre-requisites: input types must be of the same string type types must be comparable without casting |
static SqlReturnTypeInference |
rtiFirstArgType
Type-inference strategy whereby the result type of a call is the type of the first operand. |
static SqlReturnTypeInference |
rtiFirstArgTypeForceNullable
Type-inference strategy whereby the result type of a call is the type of the first operand, with nulls always allowed. |
static SqlReturnTypeInference |
rtiFirstArgTypeOrExactNoScale
Type-inference strategy whereby the result type of a call is rtiDecimalNoScale with a fallback to rtiFirstArgType This rule
is used for floor, ceiling. |
static SqlReturnTypeInference |
rtiFirstInterval
|
static SqlReturnTypeInference |
rtiHistogram
Type-inference strategy for Histogram agg support |
static SqlReturnTypeInference |
rtiInteger
Type-inference strategy whereby the result type of a call is an Integer. |
static SqlReturnTypeInference |
rtiLeastRestrictive
Type-inference strategy whereby the result type of a call is using its operands biggest type, using the SQL:1999 rules described in "Data types of results of aggregations". |
static SqlReturnTypeInference |
rtiMultiset
Returns the same type as the multiset carries. |
static SqlReturnTypeInference |
rtiMultisetFirstColumnMultiset
Returns a multiset of the first column of a multiset. |
static SqlReturnTypeInference |
rtiMultisetOnlyColumn
Returns the type of the only column of a multiset. |
static SqlReturnTypeInference |
rtiMultisetRecordMultiset
Returns a multiset of the first column of a multiset. |
static SqlReturnTypeInference |
rtiNullableBigint
Type-inference strategy whereby the result type of a call is an Bigint with nulls allowed if any of the operands allow nulls. |
static SqlReturnTypeInference |
rtiNullableBoolean
Type-inference strategy whereby the result type of a call is Boolean, with nulls allowed if any of the operands allow nulls. |
static SqlReturnTypeInference |
rtiNullableDecimalProduct
Same as rtiDecimalProduct but returns with nullablity if any of
the operands is nullable by using SqlTypeTransforms.toNullable |
static SqlReturnTypeInference |
rtiNullableDecimalQuotient
Same as rtiDecimalQuotient but returns with nullablity if any of
the operands is nullable by using SqlTypeTransforms.toNullable |
static SqlReturnTypeInference |
rtiNullableDecimalSum
Same as rtiNullableDecimalSum but returns with nullablity if any
of the operands is nullable by using SqlTypeTransforms.toNullable |
static SqlReturnTypeInference |
rtiNullableDouble
Type-inference strategy whereby the result type of a call is Double with nulls allowed if any of the operands allow nulls. |
static SqlReturnTypeInference |
rtiNullableDyadicStringSumPrecision
Same as rtiDyadicStringSumPrecision and using SqlTypeTransforms.toNullable |
static SqlReturnTypeInference |
rtiNullableFirstArgType
Type-inference strategy whereby the result type of a call is the type of the first operand. |
static SqlReturnTypeInference |
rtiNullableFirstInterval
|
static SqlReturnTypeInference |
rtiNullableInteger
Type-inference strategy whereby the result type of a call is an Integer with nulls allowed if any of the operands allow nulls. |
static SqlReturnTypeInference |
rtiNullableIntegerQuotient
Type-inference strategy whereby the result type of a call is rtiNullableFirstInterval and rtiLeastRestrictive . |
static SqlReturnTypeInference |
rtiNullableMultiset
Same as rtiMultiset but returns with nullablity if any of the
operands is nullable |
static SqlReturnTypeInference |
rtiNullableMultisetElementType
Returns the element type of a multiset |
static SqlReturnTypeInference |
rtiNullableProduct
Type-inference strategy whereby the result type of a call is rtiNullableDecimalProduct with a fallback to rtiNullableFirstInterval and rtiLeastRestrictive These rules
are used for multiplication. |
static SqlReturnTypeInference |
rtiNullableQuotient
Type-inference strategy whereby the result type of a call is rtiNullableDecimalQuotient with a fallback to rtiNullableFirstInterval and rtiLeastRestrictive These rules
are used for division. |
static SqlReturnTypeInference |
rtiNullableSecondArgType
Type-inference strategy whereby the result type of a call is the type of the second operand. |
static SqlReturnTypeInference |
rtiNullableSum
Type-inference strategy whereby the result type of a call is rtiNullableDecimalSum with a fallback to rtiLeastRestrictive
These rules are used for addition and subtraction. |
static SqlReturnTypeInference |
rtiNullableThirdArgType
Type-inference strategy whereby the result type of a call is the type of the third operand. |
static SqlReturnTypeInference |
rtiNullableTime
Type-inference strategy whereby the result type of a call is nullable Time(0). |
static SqlReturnTypeInference |
rtiNullableVaryingDyadicStringSumPrecision
Same as rtiDyadicStringSumPrecision and using SqlTypeTransforms.toNullable , SqlTypeTransforms.toVarying . |
static SqlReturnTypeInference |
rtiNullableVaryingFirstArgType
Type-inference strategy whereby the result type of a call is VARYING the type of the first argument. |
static SqlReturnTypeInference |
rtiRecordToScalarType
Returns the field type of a structured type which has only one field. |
static SqlReturnTypeInference |
rtiScope
Type-inference strategy where the expression is assumed to be registered as a SqlValidatorNamespace , and
therefore the result type of the call is the type of that namespace. |
static SqlReturnTypeInference |
rtiSecondArgType
Type-inference strategy whereby the result type of a call is the type of the second operand. |
static SqlReturnTypeInference |
rtiThirdArgType
Type-inference strategy whereby the result type of a call is the type of the third operand. |
static SqlReturnTypeInference |
rtiTime
Type-inference strategy whereby the result type of a call is Time(0). |
static SqlReturnTypeInference |
rtiVarchar2000
Type-inference strategy which always returns "VARCHAR(2000)". |
Constructor Summary | |
---|---|
SqlTypeStrategies()
|
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final SqlSingleOperandTypeChecker otcNiladic
public static final SqlOperandTypeChecker otcVariadic
public static final SqlSingleOperandTypeChecker otcBool
public static final SqlSingleOperandTypeChecker otcBoolX2
public static final SqlSingleOperandTypeChecker otcNumeric
public static final SqlSingleOperandTypeChecker otcNumericX2
public static final SqlSingleOperandTypeChecker otcExactNumeric
public static final SqlSingleOperandTypeChecker otcExactNumericX2
public static final SqlSingleOperandTypeChecker otcBinary
public static final SqlSingleOperandTypeChecker otcString
public static final SqlSingleOperandTypeChecker otcCharString
public static final SqlSingleOperandTypeChecker otcDatetime
public static final SqlSingleOperandTypeChecker otcInterval
public static final SqlSingleOperandTypeChecker otcMultiset
public static final SqlSingleOperandTypeChecker otcNullableLit
public static final SqlSingleOperandTypeChecker otcNotNullLit
public static final SqlSingleOperandTypeChecker otcPositiveIntLit
public static final SqlOperandTypeChecker otcSameX2
public static final SqlOperandTypeChecker otcSameX3
public static final SqlOperandTypeChecker otcSameVariadic
public static final SqlOperandTypeChecker otcComparableOrderedX2
public static final SqlOperandTypeChecker otcComparableOrdered
public static final SqlOperandTypeChecker otcComparableUnorderedX2
public static final SqlSingleOperandTypeChecker otcStringSameX2
public static final SqlSingleOperandTypeChecker otcStringSameX3
public static final SqlSingleOperandTypeChecker otcStringX2Int
public static final SqlSingleOperandTypeChecker otcStringX2IntX2
public static final SqlSingleOperandTypeChecker otcAny
public static final SqlSingleOperandTypeChecker otcAnyX2
public static final SqlSingleOperandTypeChecker otcIntervalSameX2
public static final SqlSingleOperandTypeChecker otcNumericInterval
public static final SqlSingleOperandTypeChecker otcIntervalNumeric
public static final SqlSingleOperandTypeChecker otcDatetimeInterval
public static final SqlSingleOperandTypeChecker otcIntervalDatetime
public static final SqlSingleOperandTypeChecker otcPlusOperator
public static final SqlSingleOperandTypeChecker otcMultiplyOperator
public static final SqlSingleOperandTypeChecker otcDivisionOperator
public static final SqlSingleOperandTypeChecker otcMinusOperator
public static final SqlSingleOperandTypeChecker otcMinusDateOperator
public static final SqlSingleOperandTypeChecker otcNumericOrInterval
public static final SqlSingleOperandTypeChecker otcDatetimeOrInterval
public static final SqlSingleOperandTypeChecker otcNumericOrString
public static final SqlSingleOperandTypeChecker otcRecordMultiset
public static final SqlSingleOperandTypeChecker otcMultisetOrRecordTypeMultiset
public static final SqlOperandTypeChecker otcMultisetX2
public static final SqlOperandTypeChecker otcSetop
public static final SqlOperandTypeChecker otcRecordToScalarType
public static final SqlReturnTypeInference rtiFirstArgType
public static final SqlReturnTypeInference rtiFirstArgTypeForceNullable
public static final SqlReturnTypeInference rtiNullableFirstArgType
public static final SqlReturnTypeInference rtiFirstInterval
public static final SqlReturnTypeInference rtiNullableFirstInterval
public static final SqlReturnTypeInference rtiNullableVaryingFirstArgType
public static final SqlReturnTypeInference rtiSecondArgType
public static final SqlReturnTypeInference rtiNullableSecondArgType
public static final SqlReturnTypeInference rtiThirdArgType
public static final SqlReturnTypeInference rtiNullableThirdArgType
public static final SqlReturnTypeInference rtiBoolean
public static final SqlReturnTypeInference rtiNullableBoolean
public static final SqlReturnTypeInference rtiDate
public static final SqlReturnTypeInference rtiTime
public static final SqlReturnTypeInference rtiNullableTime
public static final SqlReturnTypeInference rtiDouble
public static final SqlReturnTypeInference rtiNullableDouble
public static final SqlReturnTypeInference rtiInteger
public static final SqlReturnTypeInference rtiBigint
public static final SqlReturnTypeInference rtiNullableBigint
public static final SqlReturnTypeInference rtiAlwaysNullableBigint
public static final SqlReturnTypeInference rtiNullableInteger
public static final SqlReturnTypeInference rtiVarchar2000
public static final SqlReturnTypeInference rtiHistogram
public static final SqlReturnTypeInference rtiCursor
public static final SqlReturnTypeInference rtiColumnList
public static final SqlReturnTypeInference rtiLeastRestrictive
public static final SqlReturnTypeInference rtiDecimalNoScale
public static final SqlReturnTypeInference rtiFirstArgTypeOrExactNoScale
rtiDecimalNoScale
with a fallback to rtiFirstArgType
This rule
is used for floor, ceiling.
public static final SqlReturnTypeInference rtiDecimalProduct
public static final SqlReturnTypeInference rtiNullableDecimalProduct
rtiDecimalProduct
but returns with nullablity if any of
the operands is nullable by using SqlTypeTransforms.toNullable
public static final SqlReturnTypeInference rtiNullableProduct
rtiNullableDecimalProduct
with a fallback to rtiNullableFirstInterval
and rtiLeastRestrictive
These rules
are used for multiplication.
public static final SqlReturnTypeInference rtiDecimalQuotient
public static final SqlReturnTypeInference rtiNullableDecimalQuotient
rtiDecimalQuotient
but returns with nullablity if any of
the operands is nullable by using SqlTypeTransforms.toNullable
public static final SqlReturnTypeInference rtiNullableQuotient
rtiNullableDecimalQuotient
with a fallback to rtiNullableFirstInterval
and rtiLeastRestrictive
These rules
are used for division.
public static final SqlReturnTypeInference rtiNullableIntegerQuotient
rtiNullableFirstInterval
and rtiLeastRestrictive
. These rules
are used for integer division.
public static final SqlReturnTypeInference rtiDecimalSum
public static final SqlReturnTypeInference rtiNullableDecimalSum
rtiNullableDecimalSum
but returns with nullablity if any
of the operands is nullable by using SqlTypeTransforms.toNullable
public static final SqlReturnTypeInference rtiNullableSum
rtiNullableDecimalSum
with a fallback to rtiLeastRestrictive
These rules are used for addition and subtraction.
public static final SqlReturnTypeInference rtiDyadicStringSumPrecision
public static final SqlReturnTypeInference rtiNullableDyadicStringSumPrecision
rtiDyadicStringSumPrecision
and using SqlTypeTransforms.toNullable
public static final SqlReturnTypeInference rtiNullableVaryingDyadicStringSumPrecision
rtiDyadicStringSumPrecision
and using SqlTypeTransforms.toNullable
, SqlTypeTransforms.toVarying
.
public static final SqlReturnTypeInference rtiScope
SqlValidatorNamespace
, and
therefore the result type of the call is the type of that namespace.
public static final SqlReturnTypeInference rtiMultiset
public static final SqlReturnTypeInference rtiMultisetFirstColumnMultiset
RECORD(x INTEGER, y DATE) MULTISET
, returns INTEGER
MULTISET
.
public static final SqlReturnTypeInference rtiMultisetRecordMultiset
INTEGER MULTISET
, returns RECORD(x INTEGER)
MULTISET
.
public static final SqlReturnTypeInference rtiMultisetOnlyColumn
For example, given RECORD(x INTEGER) MULTISET
, returns
INTEGER MULTISET
.
public static final SqlReturnTypeInference rtiNullableMultiset
rtiMultiset
but returns with nullablity if any of the
operands is nullable
public static final SqlReturnTypeInference rtiNullableMultisetElementType
public static final SqlReturnTypeInference rtiRecordToScalarType
RECORD(x INTEGER)
returns
INTEGER
.
public static final SqlOperandTypeInference otiFirstKnown
public static final SqlOperandTypeInference otiReturnType
public static final SqlOperandTypeInference otiBoolean
Constructor Detail |
---|
public SqlTypeStrategies()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |