aokolnychyi commented on a change in pull request #3992:
URL: https://github.com/apache/iceberg/pull/3992#discussion_r793849424



##########
File path: 
spark/v3.2/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/MergeRowsExec.scala
##########
@@ -46,6 +48,16 @@ case class MergeRowsExec(
     output: Seq[Attribute],
     child: SparkPlan) extends UnaryExecNode {
 
+  override def requiredChildOrdering: Seq[Seq[SortOrder]] = {
+    // request a local sort by the row ID attrs if shuffle hash joins are 
enabled
+    // this is needed to co-locate matches for the same target row after the 
shuffle
+    if (performCardinalityCheck && !conf.preferSortMergeJoin) {

Review comment:
       Yeah, the problem is that only Spark knows which join type it is going 
to select and we have almost no control over it. I knew we won’t have a shuffle 
hash join if that config is set in the non-AQE path. I need to take a closer 
look at AQE. If it can add a shuffle hash join, then we probably have to always 
request a sort.




-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to