spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsxwing <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-8862][SPARK-8862][SQL] Add basic instru...
Date Thu, 30 Jul 2015 04:18:37 GMT
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7774#discussion_r35837036
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/joins/BroadcastHashOuterJoin.scala
---
    @@ -57,13 +57,26 @@ case class BroadcastHashOuterJoin(
       override def requiredChildDistribution: Seq[Distribution] =
         UnspecifiedDistribution :: UnspecifiedDistribution :: Nil
     
    +  /**
    +   * Use lazy so that we won't do broadcast when calling explain but still cache the
broadcast value
    +   * for the same query.
    +   */
       @transient
    -  private val broadcastFuture = future {
    -    // Note that we use .execute().collect() because we don't want to convert data to
Scala types
    -    val input: Array[InternalRow] = buildPlan.execute().map(_.copy()).collect()
    -    val hashed = HashedRelation(input.iterator, buildKeyGenerator, input.size)
    -    sparkContext.broadcast(hashed)
    -  }(BroadcastHashOuterJoin.broadcastHashOuterJoinExecutionContext)
    +  private lazy val broadcastFuture = {
    --- End diff --
    
    Although @mateiz removed `lazy` in #1990, I want to add it back here. Because without
`lazy`, if the user runs `explain`, the `broadcastFuture` will run and I cannot track the
job.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message