NoahKusaba opened a new issue, #2953:
URL: https://github.com/apache/datafusion-ballista/issues/2953
**Describe the bug**
With the adaptive planner, a correlated `NOT IN` subquery fails to plan when
the null-aware anti join gets more than one key:
```
SelectJoinRule
caused by
Error during planning: null_aware LeftAnti join with 2 keys needs the number
of its `NOT IN` value keys, set it with `with_null_aware_value_keys`
```
The static planner runs it.
**To Reproduce**
Standalone Ballista on `main` (446fa54c9) with
`ballista.planner.adaptive.enabled = true` and default settings otherwise.
```sql
WITH t3(z) AS (VALUES (10), (NULL), (7)),
t4(id, z) AS (VALUES (NULL, 10), (1, 99), (2, 7))
SELECT z FROM t3
WHERE 1 NOT IN (SELECT t4.id FROM t4 WHERE t4.z = t3.z)
ORDER BY z;
```
**Expected behavior**
`7`, `NULL`, as DataFusion and the static planner return.
**Additional context**
Found by running DataFusion's sqllogictest files on Ballista (#2945). 24
records fail this way in `null_aware_anti_join.slt` and
`null_aware_mark_join.slt`, for example `SELECT * FROM test_table t1 WHERE c1
NOT IN (SELECT c2 FROM test_table t2 WHERE t1.c1 = t2.c1)`.
--
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]