| Interface | Description |
|---|---|
| TypeCoercion |
Default strategies to coerce differing types that participate in
operations into compatible ones.
|
| TypeCoercionFactory |
Factory for
TypeCoercion objects. |
| Class | Description |
|---|---|
| AbstractTypeCoercion |
Base class for all the type coercion rules.
|
| TypeCoercionImpl |
Default implementation of Calcite implicit type cast.
|
| TypeCoercions |
Factory class for type coercion instantiation of different sql dialects.
|
This package contains rules for implicit type coercion, it works during
the process of SQL validation. The transformation entrance are all kinds of
checkers. i.e.
AssignableOperandTypeChecker,
ComparableOperandTypeChecker
CompositeOperandTypeChecker,
FamilyOperandTypeChecker,
SameOperandTypeChecker,
SetopOperandTypeChecker.
SqlNode,
and the type coercion is turned on(default), the validator will check the
operands/return types of all kinds of operators, if the validation passes through,
the validator will just cache the data type (say RelDataType) for the
SqlNode it has validated;TypeCoercion about
if there can make implicit type coercion, if the coercion rules passed, the
TypeCoercion component
will replace the SqlNode with a casted one,
(the node may be an operand of an operator or a column field of a selected row).TypeCoercion
will then update the inferred type for the casted node and
the containing operator/row column type.For some cases, although the validation passes, we still need the type coercion, e.g. for expression 1 > '1', Calcite will just return false without type coercion, we do type coercion eagerly here: the result expression would be transformed to "1 > cast('1' as int)" and the result would be true.
The supported conversion contexts are: Conversion Expressions
Strategies for Finding Common Type:
See CalciteImplicitCasts.
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.