[ 
https://issues.apache.org/jira/browse/CALCITE-7323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18045700#comment-18045700
 ] 

Yu Xu edited comment on CALCITE-7323 at 12/17/25 1:44 AM:
----------------------------------------------------------

Fixed in 
[90c8230|https://github.com/apache/calcite/commit/55aec64a33d2b6d69043b522df9393268721a5a2]
  

Thank you for the review! [~mbudiu] [~jensen] [~nobigo] 


was (Author: JIRAUSER307770):
Fixed in 
https://github.com/apache/calcite/commit/90c82303c7c81e482c02186ce58cb36bf53275a6

Thank you for the review! [~mbudiu] [~jensen] [~nobigo] 

> Result of cast Number to Boolean is not correct
> -----------------------------------------------
>
>                 Key: CALCITE-7323
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7323
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.42.0
>
>
> This test in SqlOperatorTest:
> {code:java}
> SqlOperatorFixture f = fixture();
> f.checkScalar("CAST(0 AS BOOLEAN)", "false", "BOOLEAN NOT NULL"); 
> f.checkScalar("CAST(1 AS BOOLEAN)", "false", "BOOLEAN NOT NULL"); {code}
>  
> Based on this test result, converting any numeric type to Boolean always 
> returns false, which seems unreasonable.
> Non-zero numbers should be converted to true, and zero to false. This is just 
> my understanding.



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

Reply via email to