andreaschat-db commented on code in PR #56121:
URL: https://github.com/apache/spark/pull/56121#discussion_r3357852296


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/InMemoryBaseTable.scala:
##########
@@ -684,6 +666,18 @@ abstract class InMemoryBaseTable(
       options: CaseInsensitiveStringMap)
     extends BatchScanBaseClass(_data, readSchema, tableSchema) with 
SupportsRuntimeFiltering {
 
+    // Snapshot of the table version when this scan was built.
+    val builtAtTableVersion: Int = InMemoryBaseTable.this.tableVersion
+
+    // The current table version, read fresh on each access.
+    def currentTableVersion: Int = InMemoryBaseTable.this.tableVersion

Review Comment:
   Yeah that was a workaround to a test infra limitation. So essentially all 
table references point to the same mutable `InMemoryTable`. I changed the test 
data store to return a copy of the InMemoryTable at load. That is more 
reminiscent to a snapshot semantic. So when cache references a table this is 
isolated from the main copy of the table.



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

Reply via email to