bvarghese1 commented on code in PR #30076:
URL: https://github.com/apache/flink/pull/30076#discussion_r4700883855


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/ReplaceIntersectWithSemiJoinRule.java:
##########
@@ -71,6 +86,9 @@ public void onMatch(RelOptRuleCall call) {
 
         relBuilder.push(left);
         relBuilder.push(right);
+        if (config.isDistinctRightInput()) {
+            relBuilder.distinct();

Review Comment:
   The old test had an NDV, so the base plan already took the 
`chooseSemiBuildDistinct` path, and there only the sizing was wrong. q14 
doesn't take that path because the right input is three item columns coming out 
of a join, and the NDV check doesn't pass. So fixing the sizing in 
`chooseSemiBuildDistinct` doesn't change q14.
   
   I have updated the test, now the right input is item attributes from sales 
JOIN item, with row counts only. Without this change it builds on the left with 
no distinct. With it, the right input is deduplicated and broadcast, and the 
distinct is pushed below the join.



-- 
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]

Reply via email to