uros-b commented on code in PR #56486:
URL: https://github.com/apache/spark/pull/56486#discussion_r3444237946


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/read/SupportsPushDownJoin.java:
##########
@@ -63,6 +65,61 @@ boolean pushDownJoin(
       Predicate condition
   );
 
+  /**
+   * Pushes down the join of the current {@code SupportsPushDownJoin} and the 
other side of join
+   * {@code SupportsPushDownJoin}, with pushed samples from either side.
+   *
+   * @param other {@code SupportsPushDownJoin} that this {@code 
SupportsPushDownJoin}
+   * gets joined with.
+   * @param joinType the type of join.
+   * @param leftSideRequiredColumnsWithAliases required output of the
+   *                                           left side {@code 
SupportsPushDownJoin}
+   * @param rightSideRequiredColumnsWithAliases required output of the
+   *                                            right side {@code 
SupportsPushDownJoin}
+   * @param condition join condition. Columns are named after the specified 
aliases in
+   * {@code leftSideRequiredColumnWithAliases} and {@code 
rightSideRequiredColumnWithAliases}
+   * @param leftSample pushed sample from the left side, or null if there is 
no pushed sample.
+   * @param rightSample pushed sample from the right side, or null if there is 
no pushed sample.
+   * @return True if join has been successfully pushed down.
+   *
+   * @since 4.2.0

Review Comment:
   ```suggestion
      * @since 4.3.0
   ```



##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/read/SupportsPushDownJoin.java:
##########
@@ -63,6 +65,61 @@ boolean pushDownJoin(
       Predicate condition
   );
 
+  /**
+   * Pushes down the join of the current {@code SupportsPushDownJoin} and the 
other side of join
+   * {@code SupportsPushDownJoin}, with pushed samples from either side.
+   *
+   * @param other {@code SupportsPushDownJoin} that this {@code 
SupportsPushDownJoin}
+   * gets joined with.
+   * @param joinType the type of join.
+   * @param leftSideRequiredColumnsWithAliases required output of the
+   *                                           left side {@code 
SupportsPushDownJoin}
+   * @param rightSideRequiredColumnsWithAliases required output of the
+   *                                            right side {@code 
SupportsPushDownJoin}
+   * @param condition join condition. Columns are named after the specified 
aliases in
+   * {@code leftSideRequiredColumnWithAliases} and {@code 
rightSideRequiredColumnWithAliases}
+   * @param leftSample pushed sample from the left side, or null if there is 
no pushed sample.
+   * @param rightSample pushed sample from the right side, or null if there is 
no pushed sample.
+   * @return True if join has been successfully pushed down.
+   *
+   * @since 4.2.0
+   */
+  default boolean pushDownJoin(
+      SupportsPushDownJoin other,
+      JoinType joinType,
+      ColumnWithAlias[] leftSideRequiredColumnsWithAliases,
+      ColumnWithAlias[] rightSideRequiredColumnsWithAliases,
+      Predicate condition,
+      @Nullable TableSample leftSample,
+      @Nullable TableSample rightSample) {
+    if ((leftSample == null || leftSample.isNoOp()) &&
+        (rightSample == null || rightSample.isNoOp())) {
+      return pushDownJoin(
+          other,
+          joinType,
+          leftSideRequiredColumnsWithAliases,
+          rightSideRequiredColumnsWithAliases,
+          condition);
+    }
+    return false;
+  }
+
+  /**
+   * A pushed table sample from one side of the join.
+   *
+   * @since 4.2.0

Review Comment:
   Same as https://github.com/apache/spark/pull/56486/changes#r3444237946.



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

Reply via email to