Github user chhao01 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8023#discussion_r37487286
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala ---
    @@ -97,13 +106,13 @@ private[sql] class CacheManager(sqlContext: 
SQLContext) extends Logging {
           logWarning("Asked to cache already cached data.")
         } else {
           cachedData +=
    -        CachedData(
    +        new CachedData(
               planToCache,
               InMemoryRelation(
                 sqlContext.conf.useCompression,
                 sqlContext.conf.columnBatchSize,
                 storageLevel,
    -            sqlContext.executePlan(query.logicalPlan).executedPlan,
    +            sqlContext.executePlan(planToCache).executedPlan,
    --- End diff --
    
    This is just an optimization, and we don't want to re-analysis the logical 
plan as it's done right before the calls.
    
    When you check the full code of the function `cacheQuery`, you will see the 
`planToCache` is just a local variable, not a logical plan cached by somewhere 
else, it should not be the case you were talking.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to