NoahKusaba opened a new issue, #2954:
URL: https://github.com/apache/datafusion-ballista/issues/2954
**Describe the bug**
With the adaptive planner, a `NOT IN` whose left side is a constant returns
record batches with an empty schema, while the plan's schema has the selected
column. The rows are right (none), but a caller that checks batches against the
plan's schema fails. DataFusion's sqllogictest runner reports:
```
Internal error: Schema mismatch. Previously had Schema { fields: [Field {
name: "id", data_type: Int32, nullable: true }] } Got: Schema { fields: [] }
```
The static planner returns batches with the `id` column.
**To Reproduce**
Standalone Ballista on `main` (446fa54c9) with
`ballista.planner.adaptive.enabled = true` and default settings otherwise.
```sql
WITH t1(id) AS (VALUES (1), (2)), t2(id) AS (VALUES (1), (NULL))
SELECT id FROM t1 WHERE 1 NOT IN (SELECT id FROM t2) ORDER BY id;
```
`collect()` returns a batch whose schema has no fields.
**Expected behavior**
No rows, with batches (if any) that have the plan's schema (`id`).
**Additional context**
Found by running DataFusion's sqllogictest files on Ballista (#2945):
`null_aware_anti_join.slt` 668 and a second record in the same file.
--
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]