dongjoon-hyun commented on code in PR #53859:
URL: https://github.com/apache/spark/pull/53859#discussion_r2710507265


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala:
##########
@@ -688,21 +691,40 @@ case class EnsureRequirements(
           replicatePartitions = replicatePartitions
         )
       )
+      newScan.copyTagsFrom(scan)
+      newScan
     case node =>
       node.mapChildren(child => populateCommonPartitionInfo(
         child, values, joinKeyPositions, reducers, applyPartialClustering, 
replicatePartitions))
   }
 
+  private def disableKeyGroupingIfNotNeeded(child: SparkPlan) = {
+    if (canApplyPartialClusteredDistribution(child)) {
+      populateNoGroupingPartitionInfo(child)
+    } else {
+      child
+    }
+  }
+
+  private def populateNoGroupingPartitionInfo(plan: SparkPlan): SparkPlan = 
plan match {
+    case scan: BatchScanExec =>
+      val newScan = scan.copy(spjParams = scan.spjParams.copy(noGrouping = 
true))
+      newScan.copyTagsFrom(scan)
+      newScan
+    case node => node.mapChildren(child => 
populateNoGroupingPartitionInfo(child))
+  }
 
   private def populateJoinKeyPositions(
       plan: SparkPlan,
       joinKeyPositions: Option[Seq[Int]]): SparkPlan = plan match {
     case scan: BatchScanExec =>
-      scan.copy(
+      val newScan = scan.copy(
         spjParams = scan.spjParams.copy(
           joinKeyPositions = joinKeyPositions
         )
       )
+      newScan.copyTagsFrom(scan)

Review Comment:
   ditto. We need a new JIRA for the missing `copyTagsFrom` issue.



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