aokolnychyi commented on code in PR #52920:
URL: https://github.com/apache/spark/pull/52920#discussion_r2525049861
##########
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala:
##########
@@ -965,8 +965,14 @@ class DataSourceV2SQLSuiteV1Filter
checkAnswer(sql(s"SELECT * FROM $view"),
spark.table("source").select("id"))
val oldView = spark.table(view)
+ assert(spark.sharedState.cacheManager.numCachedEntries == 1)
sql(s"REPLACE TABLE $t (a bigint) USING foo")
-
assert(spark.sharedState.cacheManager.lookupCachedData(oldView).isEmpty)
+ // it is no longer valid to materialize oldView as underlying
+ // query execution captured original table before replace
+ // yet cache invalidation must work correctly
Review Comment:
Basically we perform initial analysis on one table and then refresh it to a
completely different table (with potentially compatible schema). It seems safer
to fail and ask to re-execute.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]