This is an automated email from the ASF dual-hosted git repository.

szehon-ho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 420b9e2c966d [SPARK-57644][SQL] TxnTableCatalog should delegate 
capabilities to underlying catalog
420b9e2c966d is described below

commit 420b9e2c966df003e02d8ca0067baa0338b0d41a
Author: Szehon Ho <[email protected]>
AuthorDate: Wed Jun 24 13:55:53 2026 -0700

    [SPARK-57644][SQL] TxnTableCatalog should delegate capabilities to 
underlying catalog
    
    ### What changes were proposed in this pull request?
    
    `TxnTableCatalog` wraps `InMemoryRowLevelOperationTableCatalog` for 
transactional row-level operation tests but does not delegate `capabilities()` 
to the underlying catalog. This means any capability check through the 
transactional wrapper returns an empty set.
    
    Fix by delegating `capabilities()` to the underlying catalog.
    
    ### Why are the changes needed?
    
    Without this delegation, capability-gated features are invisible through 
the transactional catalog wrapper. For example, 
`SUPPORT_GENERATED_COLUMN_ON_WRITE` (added in SPARK-57644) cannot be checked 
when the catalog is accessed through `TxnTableCatalog`, even though the 
underlying `InMemoryRowLevelOperationTableCatalog` declares the capability.
    
    ### Does this PR introduce _any_ user-facing change?
    
    The TxnTableCatalog will expose the capabilities of the underlying Catalog.
    
    ### How was this patch tested?
    
    Existing tests pass. This is a prerequisite for testing generated column 
MERGE/UPDATE blocking in SPARK-57644.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Code (claude-opus-4-6)
    
    Closes #56713 from szehon-ho/txn-catalog-capabilities.
    
    Authored-by: Szehon Ho <[email protected]>
    Signed-off-by: Szehon Ho <[email protected]>
---
 .../src/test/scala/org/apache/spark/sql/connector/catalog/txns.scala    | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/txns.scala 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/txns.scala
index 203aed450a5f..0d060b9134a4 100644
--- 
a/sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/txns.scala
+++ 
b/sql/catalyst/src/test/scala/org/apache/spark/sql/connector/catalog/txns.scala
@@ -179,6 +179,8 @@ class TxnTableCatalog(delegate: 
InMemoryRowLevelOperationTableCatalog) extends T
 
   override def name: String = delegate.name
 
+  override def capabilities: java.util.Set[TableCatalogCapability] = 
delegate.capabilities
+
   override def initialize(name: String, options: CaseInsensitiveStringMap): 
Unit = {}
 
   override def listTables(namespace: Array[String]): Array[Identifier] = {


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

Reply via email to