yujun777 commented on PR #62742: URL: https://github.com/apache/doris/pull/62742#issuecomment-4303614180
Thanks for the reviews. Consolidated response: 1. **`PushDownJoinOtherCondition` – false positive.** The current HEAD of this PR already adds the `containsUniqueFunction()` guard at `PushDownJoinOtherCondition.java:85-87`. Any conjunct containing a unique function is routed into `remainingOther` and is never pushed to a single child. The empirical shape I verified before merging matches this: `ON rand() > 0.5` and `ON t1.id + rand() > 5` stay in the join's other-conjuncts list. The review comment appears to have analyzed the pre-change version of the file. 2. **`PushDownFilterThroughSetOperation` – valid and already fixed in a follow-up.** This is the batch-2 rule in the audit and is addressed in #62754, which splits conjuncts so that `UniqueFunction` predicates above `UNION DISTINCT` / `INTERSECT` / `EXCEPT` remain above the set op while safe conjuncts continue to push down. Regression coverage for EXCEPT / INTERSECT / UNION DISTINCT with `rand()` / `uuid()` is added there. 3. **Normalized-slot NLJ path (`ProjectOtherJoinConditionForNestedLoopJoin` → later `PUSH_DOWN_FILTERS`).** The root cause is Doris' `BETWEEN` rewrite expanding `expr BETWEEN a AND b` into `expr >= a AND expr <= b`, duplicating any `UniqueFunction` inside `expr`. Once duplicated, the later `AddProjectForUniqueFunction.JoinRewrite` materializes one alias into the left child project to keep the two bound checks consistent with a single value. Both options (keep duplicates inline per-pair, or alias into a child) lose some part of the original `BETWEEN` semantics that was already destroyed at the split step; the current choice is the less-bad option in practice. Full discussion is in the #62754 reply. This is a pre-existing trade-off in `AddProjectForUniqueFunction`, not something introduced by this PR's changes to `PushDownJoinOtherCondition` / `PushDownFilterThroughWindow` / `PushDownFilterThroughPartitionTopN`, so it is intentionally out of scope here. -- 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]
