You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Tanner Clary (Jira)" <ji...@apache.org> on 2023/11/30 00:09:00 UTC

[jira] [Resolved] (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 ]

Tanner Clary resolved CALCITE-6086.
-----------------------------------
    Resolution: Duplicate

Closing as a duplicate of CALCITE-6117

> 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
>
> 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)