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

    https://github.com/apache/spark/pull/13566#discussion_r66541029
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala ---
    @@ -157,4 +161,49 @@ private[sql] class CacheManager extends Logging {
           case _ =>
         }
       }
    +
    +  /**
    +   * Invalidates the cache of any data that contains `resourcePath` in one 
or more
    +   * `HadoopFsRelation` node(s) as part of its logical plan.
    +   */
    +  private[sql] def invalidateCachedPath(
    +      sparkSession: SparkSession, resourcePath: String): Unit = writeLock {
    +    val (fs, qualifiedPath) = {
    +      val path = new Path(resourcePath)
    +      val fs = 
path.getFileSystem(sparkSession.sessionState.newHadoopConf())
    +      (fs, path.makeQualified(fs.getUri, fs.getWorkingDirectory))
    +    }
    +
    +    cachedData.foreach {
    +      case data if data.plan.find(lookupAndRefresh(_, fs, 
qualifiedPath)).isDefined =>
    +        val dataIndex = cachedData.indexWhere(cd => 
data.plan.sameResult(cd.plan))
    +        if (dataIndex >= 0) {
    +          
cachedData(dataIndex).cachedRepresentation.cachedColumnBuffers.unpersist(blocking
 = true)
    +          cachedData.remove(dataIndex)
    --- End diff --
    
    Once we refresh the LogicalRelation and unpersist the cachedRepresentation, 
do we still need to remove it and add it back?


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