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 2019/05/16 06:09:53 UTC

[GitHub] [spark] jzhuge commented on a change in pull request #24623: [SPARK-27739][SQL] df.persist should save stats from optimized plan

jzhuge commented on a change in pull request #24623: [SPARK-27739][SQL] df.persist should save stats from optimized plan
URL: https://github.com/apache/spark/pull/24623#discussion_r284550664
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala
 ##########
 @@ -79,12 +79,13 @@ class CacheManager extends Logging {
       logWarning("Asked to cache already cached data.")
     } else {
       val sparkSession = query.sparkSession
+      val qe = sparkSession.sessionState.executePlan(planToCache)
       val inMemoryRelation = InMemoryRelation(
         sparkSession.sessionState.conf.useCompression,
         sparkSession.sessionState.conf.columnBatchSize, storageLevel,
-        sparkSession.sessionState.executePlan(planToCache).executedPlan,
+        qe.executedPlan,
         tableName,
-        planToCache)
+        qe.optimizedPlan)
 
 Review comment:
   Thanks @dongjoon-hyun for the review. Unfortunately I couldn't find a good way to unit test the accuracy of `InMemoryRelation.statsOfPlanToCache` and there is no existing unit test for this field. Any suggestion is welcome.

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