You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Sergey Nuyanzin (Jira)" <ji...@apache.org> on 2024/04/22 14:30:00 UTC
[jira] [Updated] (CALCITE-6086) SqlImplementor does not properly handle SAFE_CAST
[ https://issues.apache.org/jira/browse/CALCITE-6086?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Nuyanzin updated CALCITE-6086:
-------------------------------------
Fix Version/s: 1.37.0
> SqlImplementor does not properly handle SAFE_CAST
> -------------------------------------------------
>
> Key: CALCITE-6086
> URL: https://issues.apache.org/jira/browse/CALCITE-6086
> Project: Calcite
> Issue Type: Bug
> Reporter: Steven Talbot
> Assignee: Oliver Lee
> Priority: Major
> Fix For: 1.37.0
>
>
> This blockĀ
> [https://github.com/apache/calcite/blob/782d327d24c04e2161102b22f8880204462befd4/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java#L815]
> needs to fire for the (added in 1.35.0) kind SqlKind.SAFE_CAST, or the SAFE_CAST does not work in SQL.
> I could submit a repro if it's not obvious, but it should be as simple as something like `b.scan("emps").project(b.rexBuilder.makeAbstractCast(b.typeFactory.createSqlType(SqlTypeName.INTEGER), b.field(0), true))` and trying to write SQL from that. The second SqlDataTypeSpec argument won't get added, and it will fail the assertion error about two operands in SqlCastFunction.unparse
--
This message was sent by Atlassian Jira
(v8.20.10#820010)