AnishMahto commented on code in PR #56378:
URL: https://github.com/apache/spark/pull/56378#discussion_r3382947040


##########
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:
   Makes enough sense to me, although I _am_ a little scared about this 
truncate-table load path divergence causing subtle bugs in the future.
   
   By construction/API contract if production catalogs start implementing 
`TransactionalCatalogPlugin` the same way that the test-only in-memory catalog 
does, will they run into the same issue?
   
   IIUC `TransactionalCatalogPlugin` will be introduced as part of Spark 4.2+ 
so no production catalogs implement it today, but looking ahead I want to make 
sure we aren't overlooking an incompatibility.



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