org.eigenbase.sql.type
Class SqlTypeStrategies

java.lang.Object
  extended by org.eigenbase.sql.type.SqlTypeStrategies

public abstract class SqlTypeStrategies
extends Object

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.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/type/SqlTypeStrategies.java#42 $
Author:
Wael Chatila

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

otcNiladic

public static final SqlSingleOperandTypeChecker otcNiladic
Operand type-checking strategy for an operator which takes no operands.


otcVariadic

public static final SqlOperandTypeChecker otcVariadic
Operand type-checking strategy for an operator with no restrictions on number or type of operands.


otcBool

public static final SqlSingleOperandTypeChecker otcBool

otcBoolX2

public static final SqlSingleOperandTypeChecker otcBoolX2

otcNumeric

public static final SqlSingleOperandTypeChecker otcNumeric

otcNumericX2

public static final SqlSingleOperandTypeChecker otcNumericX2

otcExactNumeric

public static final SqlSingleOperandTypeChecker otcExactNumeric

otcExactNumericX2

public static final SqlSingleOperandTypeChecker otcExactNumericX2

otcBinary

public static final SqlSingleOperandTypeChecker otcBinary

otcString

public static final SqlSingleOperandTypeChecker otcString

otcCharString

public static final SqlSingleOperandTypeChecker otcCharString

otcDatetime

public static final SqlSingleOperandTypeChecker otcDatetime

otcInterval

public static final SqlSingleOperandTypeChecker otcInterval

otcMultiset

public static final SqlSingleOperandTypeChecker otcMultiset

otcNullableLit

public static final SqlSingleOperandTypeChecker otcNullableLit
Operand type-checking strategy where type must be a literal or NULL.


otcNotNullLit

public static final SqlSingleOperandTypeChecker otcNotNullLit
Operand type-checking strategy type must be a non-NULL literal.


otcPositiveIntLit

public static final SqlSingleOperandTypeChecker otcPositiveIntLit
Operand type-checking strategy type must be a positive integer non-NULL literal.


otcSameX2

public static final SqlOperandTypeChecker otcSameX2
Operand type-checking strategy where two operands must both be in the same type family.


otcSameX3

public static final SqlOperandTypeChecker otcSameX3
Operand type-checking strategy where three operands must all be in the same type family.


otcSameVariadic

public static final SqlOperandTypeChecker otcSameVariadic
Operand type-checking strategy where any number of operands must all be in the same type family.


otcComparableOrderedX2

public static final SqlOperandTypeChecker otcComparableOrderedX2
Operand type-checking strategy where operand types must allow ordered comparisons.


otcComparableOrdered

public static final SqlOperandTypeChecker otcComparableOrdered
Operand type-checking strategy where operand type must allow ordered comparisons. Used when instance comparisons are made on single operand functions


otcComparableUnorderedX2

public static final SqlOperandTypeChecker otcComparableUnorderedX2
Operand type-checking strategy where operand types must allow unordered comparisons.


otcStringSameX2

public static final SqlSingleOperandTypeChecker otcStringSameX2
Operand type-checking strategy where two operands must both be in the same string type family.


otcStringSameX3

public static final SqlSingleOperandTypeChecker otcStringSameX3
Operand type-checking strategy where three operands must all be in the same string type family.


otcStringX2Int

public static final SqlSingleOperandTypeChecker otcStringX2Int

otcStringX2IntX2

public static final SqlSingleOperandTypeChecker otcStringX2IntX2

otcAny

public static final SqlSingleOperandTypeChecker otcAny

otcAnyX2

public static final SqlSingleOperandTypeChecker otcAnyX2

otcIntervalSameX2

public static final SqlSingleOperandTypeChecker otcIntervalSameX2
Parameter type-checking strategy type must a nullable time interval, nullable time interval


otcNumericInterval

public static final SqlSingleOperandTypeChecker otcNumericInterval

otcIntervalNumeric

public static final SqlSingleOperandTypeChecker otcIntervalNumeric

otcDatetimeInterval

public static final SqlSingleOperandTypeChecker otcDatetimeInterval

otcIntervalDatetime

public static final SqlSingleOperandTypeChecker otcIntervalDatetime

otcPlusOperator

public static final SqlSingleOperandTypeChecker otcPlusOperator

otcMultiplyOperator

public static final SqlSingleOperandTypeChecker otcMultiplyOperator
Type checking strategy for the "*" operator


otcDivisionOperator

public static final SqlSingleOperandTypeChecker otcDivisionOperator
Type checking strategy for the "/" operator


otcMinusOperator

public static final SqlSingleOperandTypeChecker otcMinusOperator

otcMinusDateOperator

public static final SqlSingleOperandTypeChecker otcMinusDateOperator

otcNumericOrInterval

public static final SqlSingleOperandTypeChecker otcNumericOrInterval

otcDatetimeOrInterval

public static final SqlSingleOperandTypeChecker otcDatetimeOrInterval

otcNumericOrString

public static final SqlSingleOperandTypeChecker otcNumericOrString

otcRecordMultiset

public static final SqlSingleOperandTypeChecker otcRecordMultiset

otcMultisetOrRecordTypeMultiset

public static final SqlSingleOperandTypeChecker otcMultisetOrRecordTypeMultiset

otcMultisetX2

public static final SqlOperandTypeChecker otcMultisetX2

otcSetop

public static final SqlOperandTypeChecker otcSetop
Operand type-checking strategy for a set operator (UNION, INTERSECT, EXCEPT).


otcRecordToScalarType

public static final SqlOperandTypeChecker otcRecordToScalarType

rtiFirstArgType

public static final SqlReturnTypeInference rtiFirstArgType
Type-inference strategy whereby the result type of a call is the type of the first operand.


rtiFirstArgTypeForceNullable

public static final SqlReturnTypeInference rtiFirstArgTypeForceNullable
Type-inference strategy whereby the result type of a call is the type of the first operand, with nulls always allowed.


rtiNullableFirstArgType

public static final SqlReturnTypeInference rtiNullableFirstArgType
Type-inference strategy whereby the result type of a call is the type of the first operand. If any of the other operands are nullable the returned type will also be nullable.


rtiFirstInterval

public static final SqlReturnTypeInference rtiFirstInterval

rtiNullableFirstInterval

public static final SqlReturnTypeInference rtiNullableFirstInterval

rtiNullableVaryingFirstArgType

public static final SqlReturnTypeInference rtiNullableVaryingFirstArgType
Type-inference strategy whereby the result type of a call is VARYING the type of the first argument. The length returned is the same as length of the first argument. If any of the other operands are nullable the returned type will also be nullable. First Arg must be of string type.


rtiSecondArgType

public static final SqlReturnTypeInference rtiSecondArgType
Type-inference strategy whereby the result type of a call is the type of the second operand.


rtiNullableSecondArgType

public static final SqlReturnTypeInference rtiNullableSecondArgType
Type-inference strategy whereby the result type of a call is the type of the second operand. If any of the other operands are nullable the returned type will also be nullable.


rtiThirdArgType

public static final SqlReturnTypeInference rtiThirdArgType
Type-inference strategy whereby the result type of a call is the type of the third operand.


rtiNullableThirdArgType

public static final SqlReturnTypeInference rtiNullableThirdArgType
Type-inference strategy whereby the result type of a call is the type of the third operand. If any of the other operands are nullable the returned type will also be nullable.


rtiBoolean

public static final SqlReturnTypeInference rtiBoolean
Type-inference strategy whereby the result type of a call is Boolean.


rtiNullableBoolean

public static final SqlReturnTypeInference rtiNullableBoolean
Type-inference strategy whereby the result type of a call is Boolean, with nulls allowed if any of the operands allow nulls.


rtiDate

public static final SqlReturnTypeInference rtiDate
Type-inference strategy whereby the result type of a call is Date.


rtiTime

public static final SqlReturnTypeInference rtiTime
Type-inference strategy whereby the result type of a call is Time(0).


rtiNullableTime

public static final SqlReturnTypeInference rtiNullableTime
Type-inference strategy whereby the result type of a call is nullable Time(0).


rtiDouble

public static final SqlReturnTypeInference rtiDouble
Type-inference strategy whereby the result type of a call is Double.


rtiNullableDouble

public static final SqlReturnTypeInference rtiNullableDouble
Type-inference strategy whereby the result type of a call is Double with nulls allowed if any of the operands allow nulls.


rtiInteger

public static final SqlReturnTypeInference rtiInteger
Type-inference strategy whereby the result type of a call is an Integer.


rtiBigint

public static final SqlReturnTypeInference rtiBigint
Type-inference strategy whereby the result type of a call is a Bigint


rtiNullableBigint

public static final 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.


rtiAlwaysNullableBigint

public static final SqlReturnTypeInference rtiAlwaysNullableBigint
Type-inference strategy whereby the result type of a call is a nullable Bigint


rtiNullableInteger

public static final 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.


rtiVarchar2000

public static final SqlReturnTypeInference rtiVarchar2000
Type-inference strategy which always returns "VARCHAR(2000)".


rtiHistogram

public static final SqlReturnTypeInference rtiHistogram
Type-inference strategy for Histogram agg support


rtiCursor

public static final SqlReturnTypeInference rtiCursor
Type-inference strategy which always returns "CURSOR".


rtiColumnList

public static final SqlReturnTypeInference rtiColumnList
Type-inference strategy which always returns "COLUMN_LIST".


rtiLeastRestrictive

public static final 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". These rules are used in union, except, intersect, case and other places.

Reference to SQL:1999 standard:
Part 2 Section 9.3

rtiDecimalNoScale

public static final SqlReturnTypeInference rtiDecimalNoScale
Type-inference strategy for a call where the first argument is a decimal. The result type of a call is a decimal with a scale of 0, and the same precision and nullibility as the first argument


rtiFirstArgTypeOrExactNoScale

public static final 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.


rtiDecimalProduct

public static final 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.


rtiNullableDecimalProduct

public static final SqlReturnTypeInference rtiNullableDecimalProduct
Same as rtiDecimalProduct but returns with nullablity if any of the operands is nullable by using SqlTypeTransforms.toNullable


rtiNullableProduct

public static final 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.


rtiDecimalQuotient

public static final 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.


rtiNullableDecimalQuotient

public static final SqlReturnTypeInference rtiNullableDecimalQuotient
Same as rtiDecimalQuotient but returns with nullablity if any of the operands is nullable by using SqlTypeTransforms.toNullable


rtiNullableQuotient

public static final 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.


rtiNullableIntegerQuotient

public static final SqlReturnTypeInference rtiNullableIntegerQuotient
Type-inference strategy whereby the result type of a call is rtiNullableFirstInterval and rtiLeastRestrictive. These rules are used for integer division.


rtiDecimalSum

public static final 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. Let p1, s1 be the precision and scale of the first operand Let p2, s2 be the precision and scale of the second operand Let p, s be the precision and scale of the result, Then the result type is a decimal with: p and s are capped at their maximum values

Reference to SQL:2003 standard:
Part 2 Section 6.26

rtiNullableDecimalSum

public static final SqlReturnTypeInference rtiNullableDecimalSum
Same as rtiNullableDecimalSum but returns with nullablity if any of the operands is nullable by using SqlTypeTransforms.toNullable


rtiNullableSum

public static final 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.


rtiDyadicStringSumPrecision

public static final SqlReturnTypeInference rtiDyadicStringSumPrecision
Type-inference strategy whereby the result type of a call is Pre-requisites:


rtiNullableDyadicStringSumPrecision

public static final SqlReturnTypeInference rtiNullableDyadicStringSumPrecision
Same as rtiDyadicStringSumPrecision and using SqlTypeTransforms.toNullable


rtiNullableVaryingDyadicStringSumPrecision

public static final SqlReturnTypeInference rtiNullableVaryingDyadicStringSumPrecision
Same as rtiDyadicStringSumPrecision and using SqlTypeTransforms.toNullable, SqlTypeTransforms.toVarying.


rtiScope

public static final 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.


rtiMultiset

public static final SqlReturnTypeInference rtiMultiset
Returns the same type as the multiset carries. The multiset type returned is the least restrictive of the call's multiset operands


rtiMultisetFirstColumnMultiset

public static final SqlReturnTypeInference rtiMultisetFirstColumnMultiset
Returns a multiset of the first column of a multiset. For example, given RECORD(x INTEGER, y DATE) MULTISET, returns INTEGER MULTISET.


rtiMultisetRecordMultiset

public static final SqlReturnTypeInference rtiMultisetRecordMultiset
Returns a multiset of the first column of a multiset. For example, given INTEGER MULTISET, returns RECORD(x INTEGER) MULTISET.


rtiMultisetOnlyColumn

public static final SqlReturnTypeInference rtiMultisetOnlyColumn
Returns the type of the only column of a multiset.

For example, given RECORD(x INTEGER) MULTISET, returns INTEGER MULTISET.


rtiNullableMultiset

public static final SqlReturnTypeInference rtiNullableMultiset
Same as rtiMultiset but returns with nullablity if any of the operands is nullable


rtiNullableMultisetElementType

public static final SqlReturnTypeInference rtiNullableMultisetElementType
Returns the element type of a multiset


rtiRecordToScalarType

public static final SqlReturnTypeInference rtiRecordToScalarType
Returns the field type of a structured type which has only one field. For example, given RECORD(x INTEGER) returns INTEGER.


otiFirstKnown

public static final SqlOperandTypeInference otiFirstKnown
Operand type-inference strategy where an unknown operand type is derived from the first operand with a known type.


otiReturnType

public static final SqlOperandTypeInference otiReturnType
Operand type-inference strategy where an unknown operand type is derived from the call's return type. If the return type is a record, it must have the same number of fields as the number of operands.


otiBoolean

public static final SqlOperandTypeInference otiBoolean
Operand type-inference strategy where an unknown operand type is assumed to be boolean.

Constructor Detail

SqlTypeStrategies

public SqlTypeStrategies()