Package org.apache.calcite.sql.type
Class SqlTypeTransforms
java.lang.Object
org.apache.calcite.sql.type.SqlTypeTransforms
SqlTypeTransforms defines a number of reusable instances of
SqlTypeTransform
.
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
FieldsModifier and TypeFieldDescriptionstatic final SqlTypeTransform
Parameter type-inference transform strategy where a derived type is transformed into the same type with nulls allowed.static final SqlTypeTransform
Parameter type-inference transform that transformsMEASURE<T>
toT
for some type T.static final SqlTypeTransform
Type-inference strategy whereby the result is NOT NULL if any of the arguments is NOT NULL; otherwise the type is unchanged.static final SqlTypeTransform
Parameter type-inference transform strategy where a derived type must be a struct type with precisely one field and the returned type is the type of that field.static final SqlTypeTransform
Parameter type-inference transform strategy that wraps a given type in a array.static final SqlTypeTransform
Parameter type-inference transform strategy that wraps a given type in an array or wraps a field of the given type in an array if the given type is struct with one field.static final SqlTypeTransform
Parameter type-inference transform strategy that converts a two-field record type to a MAP type.static final SqlTypeTransform
Parameter type-inference transform that transformsT
toMEASURE<T>
for some type T.static final SqlTypeTransform
Parameter type-inference transform strategy that wraps a given type in a multiset.static final SqlTypeTransform
Parameter type-inference transform strategy where a derived type must be a multiset type and the returned type is the multiset's element type.static final SqlTypeTransform
Parameter type-inference transform strategy that wraps a given type in a multiset or wraps a field of the given type in a multiset if the given type is struct with one field.static final SqlTypeTransform
Parameter type-inference transform strategy where a derived type is transformed into the same type but not nullable.static final SqlTypeTransform
Parameter type-inference transform strategy where a derived type is transformed into the same type but nullable if any of a calls operands is nullable.static final SqlTypeTransform
Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if all of a call's operands are nullable.static final SqlTypeTransform
Type-inference strategy whereby the result type of a call is VARYING the type given. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TO_NULLABLE
Parameter type-inference transform strategy where a derived type is transformed into the same type but nullable if any of a calls operands is nullable. -
TO_NULLABLE_ALL
Parameter type-inference transform strategy where a derived type is transformed into the same type, but nullable if and only if all of a call's operands are nullable. -
TO_NOT_NULLABLE
Parameter type-inference transform strategy where a derived type is transformed into the same type but not nullable. -
FORCE_NULLABLE
Parameter type-inference transform strategy where a derived type is transformed into the same type with nulls allowed. -
LEAST_NULLABLE
Type-inference strategy whereby the result is NOT NULL if any of the arguments is NOT NULL; otherwise the type is unchanged. -
TO_VARYING
Type-inference strategy whereby the result type of a call is VARYING the type given. The length returned is the same as length of the first argument. Return type will have same nullability as input type nullability. First Arg must be of string type. -
TO_MULTISET_ELEMENT_TYPE
Parameter type-inference transform strategy where a derived type must be a multiset type and the returned type is the multiset's element type.- See Also:
-
TO_MULTISET
Parameter type-inference transform strategy that wraps a given type in a multiset. -
TO_MULTISET_QUERY
Parameter type-inference transform strategy that wraps a given type in a multiset or wraps a field of the given type in a multiset if the given type is struct with one field. It is used when a multiset input is a sub-query. -
TO_ARRAY
Parameter type-inference transform strategy that wraps a given type in a array. -
TO_MEASURE
Parameter type-inference transform that transformsT
toMEASURE<T>
for some type T. -
FROM_MEASURE
Parameter type-inference transform that transformsMEASURE<T>
toT
for some type T. Inverse ofTO_MEASURE
. -
TO_ARRAY_QUERY
Parameter type-inference transform strategy that wraps a given type in an array or wraps a field of the given type in an array if the given type is struct with one field. It is used when an array input is a sub-query. -
TO_MAP
Parameter type-inference transform strategy that converts a two-field record type to a MAP type. -
ONLY_COLUMN
Parameter type-inference transform strategy where a derived type must be a struct type with precisely one field and the returned type is the type of that field.
-
-
Constructor Details
-
SqlTypeTransforms
public SqlTypeTransforms()
-