File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
core/src/main/scala/org/apache/spark/storage
sql/core/src/main/scala/org/apache/spark/sql Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,13 @@ private[spark] class BlockManager(
363363 val info = blockInfo.get(blockId).orNull
364364 if (info != null ) {
365365 info.synchronized {
366+ // Double check to make sure the block is still there, since removeBlock
367+ // method also synchronizes on BlockInfo object, so the block might have
368+ // been removed when we actually come here.
369+ if (blockInfo.get(blockId).isEmpty) {
370+ logDebug(s " Block $blockId had been removed " )
371+ return None
372+ }
366373
367374 // If another thread is writing the block, wait for it to become ready.
368375 if (! info.waitForReady()) {
Original file line number Diff line number Diff line change @@ -307,6 +307,8 @@ class SQLContext(@transient val sparkContext: SparkContext)
307307 lazy val optimizedPlan = optimizer(analyzed)
308308 // TODO: Don't just pick the first one...
309309 lazy val sparkPlan = planner(optimizedPlan).next()
310+ // executedPlan should not be used to initialize any SparkPlan. It should be
311+ // only used for execution.
310312 lazy val executedPlan : SparkPlan = prepareForExecution(sparkPlan)
311313
312314 /** Internal version of the RDD. Avoids copies and has no schema */
Original file line number Diff line number Diff line change @@ -251,8 +251,8 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
251251 case logical.SetCommand (key, value) =>
252252 Seq (execution.SetCommand (key, value, plan.output)(context))
253253 case logical.ExplainCommand (child) =>
254- val executedPlan = context.executePlan(child).executedPlan
255- Seq (execution.ExplainCommand (executedPlan , plan.output)(context))
254+ val sparkPlan = context.executePlan(child).sparkPlan
255+ Seq (execution.ExplainCommand (sparkPlan , plan.output)(context))
256256 case logical.CacheCommand (tableName, cache) =>
257257 Seq (execution.CacheCommand (tableName, cache)(context))
258258 case _ => Nil
You can’t perform that action at this time.
0 commit comments