Rafael Acevedo created CALCITE-6768:
---------------------------------------

             Summary: Inconsistent null behavior with quantify operators
                 Key: CALCITE-6768
                 URL: https://issues.apache.org/jira/browse/CALCITE-6768
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.38.0
            Reporter: Rafael Acevedo


Hi everyone! The quantify operators (ALL, SOME, ANY) seem to have inconsistent 
null behavior between operators (=, >= ...), even when the original operators 
work as expected.

 

Using the emps table:


{code:sql}


0: jdbc:calcite:model=src/test/resources/mode> select TRUE = ALL (select 
slacker from emps);
+--------+
| EXPR$0 |
+--------+
| false  |
+--------+
1 row selected (0.019 seconds)
0: jdbc:calcite:model=src/test/resources/mode> select TRUE >= ALL (select 
slacker from emps);
+--------+
| EXPR$0 |
+--------+
|        |
+--------+
1 row selected (0.034 seconds)
{code}

In my understanding, the expected result is null for both queries, since there 
are null entries in the "slacker" column and both = and >= are equivalent for 
booleans ({{true >= <any bool>}} and {{true = <any bool>}} always yield the 
same result)

Is this a bug? Anyway, some code pointers indicating why this happens would be 
nice.

Thanks!



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

Reply via email to