spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] cloud-fan commented on a change in pull request #27226: [SPARK-30524] [SQL] Disable OptimizeSkewedJoin rule when introducing additional shuffle
Date Thu, 16 Jan 2020 04:43:16 GMT
cloud-fan commented on a change in pull request #27226: [SPARK-30524] [SQL] Disable OptimizeSkewedJoin
rule when introducing additional shuffle
URL: https://github.com/apache/spark/pull/27226#discussion_r367228359
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
 ##########
 @@ -114,25 +120,56 @@ case class OptimizeSkewedJoin(conf: SQLConf) extends Rule[SparkPlan]
{
     stage.shuffle.shuffleDependency.rdd.partitions.length
   }
 
-  def handleSkewJoin(plan: SparkPlan): SparkPlan = plan.transformUp {
-    case smj @ SortMergeJoinExec(leftKeys, rightKeys, joinType, condition,
-        s1 @ SortExec(_, _, left: ShuffleQueryStageExec, _),
-        s2 @ SortExec(_, _, right: ShuffleQueryStageExec, _))
-      if supportedJoinTypes.contains(joinType) =>
+  private def containShuffleQueryStage(plan : SparkPlan): (Boolean, ShuffleQueryStageExec)
=
+    plan match {
+      case stage: ShuffleQueryStageExec => (true, stage)
+      case SortExec(_, _, s: ShuffleQueryStageExec, _) =>
+        (true, s)
+      case _ => (false, null)
+  }
+
+  private def reOptimizeChild(
+      skewedReader: SkewedPartitionReaderExec,
+      child: SparkPlan): SparkPlan = child match {
+    case sort @ SortExec(_, _, s: ShuffleQueryStageExec, _) =>
+      sort.copy(child = skewedReader)
+    case _ => child
 
 Review comment:
   shouldn't this be: `case _: ShuffleQueryStageExec => skewedReader`?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message