LuciferYang opened a new issue, #13709:
URL: https://github.com/apache/gluten/issues/13709
When two broadcast hash joins reuse one broadcast exchange, the executor
builds a native hash table for the first one and gives the second one a copy of
it, as long as both drop duplicate build rows or both keep them
(`ColumnarBuildSideRelation.hashTableData` is keyed by `droppedDuplicates`
only). But the table also depends on the join's filter: an anti join whose
filter is null-intolerant leaves out the build rows that are null in the
filter's columns. A second join that needs those rows gets the table without
them and returns wrong rows.
With the default configuration:
```sql
-- probe(k, x) = (1,5), (2,1), (3,7), (4,2), (5,9), (6,0), (7,4)
-- build(k, y) = (1,3), (1,null), (2,null), (3,8), (4,1), (5,null), (8,2)
SELECT 'a', k, x FROM probe WHERE NOT EXISTS
(SELECT 1 FROM build WHERE probe.k = build.k AND probe.x > build.y)
UNION ALL
SELECT 'b', k, x FROM probe WHERE EXISTS
(SELECT 1 FROM build WHERE probe.k = build.k AND (probe.x > build.y OR
build.y IS NULL))
```
Spark returns 4 rows for the second branch: (1,5), (2,1), (4,2) and (5,9).
Gluten returns only (1,5) and (4,2). With `NOT EXISTS` in the second branch,
Gluten returns 5 rows instead of 3. It reproduces on v1.8.0-rc1.
This issue was written with the assistance of AI (Claude Opus).
--
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]