findepi opened a new issue, #14352:
URL: https://github.com/apache/datafusion/issues/14352
### Describe the bug
Incorrect result for IS NOT NULL predicate over UNION ALL query
### To Reproduce
```sql
SELECT
a,
a IS NOT NULL
FROM (
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_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]