You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/13 07:41:55 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #31119: [SPARK-34064][SQL] Cancel the running broadcast sub-jobs when SQL statement is cancelled

cloud-fan commented on a change in pull request #31119:
URL: https://github.com/apache/spark/pull/31119#discussion_r556317573



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/BroadcastExchangeExec.scala
##########
@@ -74,7 +74,9 @@ case class BroadcastExchangeExec(
     child: SparkPlan) extends BroadcastExchangeLike {
   import BroadcastExchangeExec._
 
-  override val runId: UUID = UUID.randomUUID
+  private val groupId = sparkContext.getLocalProperty(SparkContext.SPARK_JOB_GROUP_ID)
+
+  override val runId: UUID = Option(groupId).map(UUID.fromString).getOrElse(UUID.randomUUID)

Review comment:
       nit: we can inline `groupId` here to save a `val`, which will increase the size of the serialized plan. We should also add a comment to explain it.




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



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