Describe the bug
Incorrect result for IS NOT NULL predicate over UNION ALL query
To Reproduce
SELECT
a,
a IS NOT NULL
FROM (
-- second column, even though it's not selected, is necessary to reproduce this bug
SELECT 'foo' AS a, 3 AS b
UNION ALL
SELECT NULL AS a, 4 AS b
)
DF
+------+---------------+
| a | a IS NOT NULL |
+------+---------------+
| NULL | true 😱 |
| foo | true |
+------+---------------+
Expected behavior
NULL valued checked with IS NOT NULL should return false
trino> SELECT
-> a,
-> a IS NOT NULL
-> FROM (
-> SELECT 'foo' AS a, 3 AS b
-> UNION ALL
-> SELECT NULL AS a, 4 AS b
-> );
a | _col1
------+-------
foo | true
NULL | false
Additional context
No response