[
https://issues.apache.org/jira/browse/CALCITE-7870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7870.
----------------------------------
Fix Version/s: 1.43.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/a2e574ec271866eb352f98d7101a386a30dc8bc8]
Thank you for your review [~asolimando]
> RexSimplify removes some casts which change semantics
> -----------------------------------------------------
>
> Key: CALCITE-7870
> URL: https://issues.apache.org/jira/browse/CALCITE-7870
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.42.0
> Reporter: Mihai Budiu
> Assignee: Mihai Budiu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.43.0
>
>
> RexSimplify will remove a cast from INT to DOUBLE in some circumstances where
> it shouldn't:
> CAST(CAST(i AS DOUBLE) AS VARCHAR)
> When i is 2, if the cast is not removed the result is 2.0. RexSimplify
> removes the cast, and the result becomes just 2.
> There are other examples:
> CAST(CAST(double AS VARCHAR(3))
> When d is 6.666666 removing the cast gives 6.66666, but the result should be
> 6.6.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)