mrhhsg opened a new pull request, #64125:
URL: https://github.com/apache/doris/pull/64125
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: When query spill is enabled, DISTINCT INTERSECT/EXCEPT
still keep set-operation plans instead of preferring spill-capable join
operators. This PR rewrites supported DISTINCT INTERSECT to distinct aggregate
+ left semi join, and DISTINCT EXCEPT/MINUS to distinct aggregate + left anti
join. The rewrite uses null-safe equality to preserve set semantics for NULL
values, and keeps the original set-operation path when spill is disabled, the
qualifier is ALL, or output types are not supported by hash join comparison.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- `./run-fe-ut.sh --run
org.apache.doris.nereids.rules.rewrite.RewriteSetOperationToJoinWhenSpillTest`
- Behavior changed: Yes. With `enable_spill = true`, supported DISTINCT
INTERSECT/EXCEPT/MINUS plans are rewritten to spill-capable joins.
- Does this need documentation: No
--
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]