feiniaofeiafei opened a new pull request, #67831:
URL: https://github.com/apache/doris/pull/67831
### What problem does this PR solve?
Problem Summary:
Transposing a semi/anti join and an aggregate changes the rows or the number
of times expressions are evaluated. Moving
`Aggregate(Project(assert_true(...))(SemiJoin(t, s)))` below the join can
evaluate assertions on rows that the join should discard. Moving a join with a
volatile ON predicate below an aggregate can filter individual input rows
instead of whole groups and change aggregate results.
Reject all four transpose rules when join conditions, aggregate group keys
or output expressions, or the intermediate project contain a
`NoneMovableFunction` or a volatile expression. Share the recursive checks in
`canTranspose` and preserve the existing join-type, mark-join and grouping-key
restrictions.
### Release note
Fix incorrect results or unexpected expression errors when semi/anti joins
and aggregates are reordered around volatile or non-movable expressions.
### Check List (For Author)
- Test:
- Unit Test: 112 tests passed, including 108 combinations of semi/anti
joins, both transpose directions, optional projects, expression locations and
volatility/non-movability.
- Regression test: `transposeSemiJoinAggExpression` and existing
`transposeSemiJoinAgg` passed on the rebuilt FE; expected results were
generated by the regression runner.
- Manual test: both assertion queries failed before deployment and
returned `(1, 64)` after deployment.
- Build: `DISABLE_BUILD_UI=ON ./build.sh --fe` passed, including
Checkstyle.
- Behavior changed: Yes. Unsafe aggregate/semi-join transpositions are
rejected.
- 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]