Yu Xu created CALCITE-7323:
------------------------------

             Summary: 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
             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