Skip navigation links
Apache Calcite

Package org.apache.calcite.sql.validate.implicit

SQL Implicit Type Cast

See: Description

Package org.apache.calcite.sql.validate.implicit Description

SQL Implicit Type Cast

Work Flow

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.

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.

Conversion SQL Contexts

The supported conversion contexts are: Conversion Expressions

Strategies for Finding Common Type:

Type Conversion Matrix

See CalciteImplicitCasts.

Skip navigation links
Apache Calcite

Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.