[ 
https://issues.apache.org/jira/browse/CALCITE-4806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mihai Budiu resolved CALCITE-4806.
----------------------------------
    Fix Version/s: 1.38.0
       Resolution: Fixed

Fixed by some earlier commit, but certified fixed in 
https://github.com/apache/calcite/commit/18e66e801979242b163b492b66ff4b76c3bdc1ea
Thank you [~nobigo] for the test

> Lossy CAST is incorrectly simplified
> ------------------------------------
>
>                 Key: CALCITE-4806
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4806
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: xuyang
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.38.0
>
>
> the sql is following:
> {code:java}
> // code placeholder
> select cast(1.1 as int) = cast (1 as int){code}
> In SQLite the result is 1 and in postgreSQL the result is true.
> But in calcite the result is false.
> The bug is in RexSimplify and 1.1 and 1 are all converted to 
> java.lang.Comparable, and 1.1 doesn't equal to 1. It ignores the source data 
> type. The literal 1.1 should be cast to 1(int) first.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to