sarutak commented on code in PR #56378:
URL: https://github.com/apache/spark/pull/56378#discussion_r3386609973
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/txns.scala:
##########
@@ -279,6 +279,10 @@ class SharedTablesInMemoryRowLevelOperationTableCatalog
super.initialize(name, options)
tables = SharedTablesInMemoryRowLevelOperationTableCatalog.sharedTables
}
+
+ // Return the live table instance (not a snapshot copy) so that TRUNCATE and
DROP
+ // mutations affect the shared catalog state immediately.
+ override def loadTable(ident: Identifier): Table = liveTable(ident)
Review Comment:
That's a valid forward-looking concern. If a production
`TransactionalCatalogPlugin` returns snapshot copies from `loadTable(ident)`,
`TRUNCATE TABLE` would indeed fail to mutate the live state. At that point, the
right fix would be in Spark's resolution path (propagating write privileges
through `UnresolvedTable`), not in the catalog implementation. This PR doesn't
preclude that future fix but just addresses the immediate test failure in the
test infrastructure.
That said, `TransactionalCatalogPlugin` is newly introduced and the API is
still evolving. What's certain today is that the test infrastructure change in
SPARK-56995 broke an existing test suite without updating the affected catalog
subclass, and this PR corrects that.
--
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]