[
https://issues.apache.org/jira/browse/CALCITE-6086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17791336#comment-17791336
]
Tanner Clary commented on CALCITE-6086:
---------------------------------------
[~swtalbot]I think this was recently resolved in
[bd7d4e8|https://github.com/apache/calcite/commit/bd7d4e89c5c4a01d4e5897fc04be224dcddaecae],
can I mark this as a duplicate?
> 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)