MaxGekk commented on a change in pull request #31172:
URL: https://github.com/apache/spark/pull/31172#discussion_r557113265



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
##########
@@ -60,21 +60,19 @@ class DataSourceV2Strategy(session: SparkSession) extends 
Strategy with Predicat
     session.sharedState.cacheManager.recacheByPlan(session, r)
   }
 
+  private def recacheTable(r: ResolvedTable)(): Unit = {
+    val v2Relation = DataSourceV2Relation.create(r.table, Some(r.catalog), 
Some(r.identifier))
+    session.sharedState.cacheManager.recacheByPlan(session, v2Relation)
+  }

Review comment:
       > ... we should make a similar change for v1 as well.
   
   I agree. We should change cache refreshing in v1 command either by 
introducing new function for that or modifying `CatalogImpl.refreshTable()`: 
https://github.com/apache/spark/blob/62d82b5b270c2eea27ba026e66b7d6598bbaa0a6/sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala#L538-L558
   which can be used for v1 as well as for v2 tables/views (potentially but I 
am not sure that it works for v2 tables for now).




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to