wangxiaojing opened a new pull request, #10475:
URL: https://github.com/apache/gravitino/pull/10475

   
   ### What changes were proposed in this pull request?
      This PR modifies the GravitinoPaimonCatalog to override the getTable() 
and tableExists() methods. These methods now delegate their calls to the 
underlying Paimon FlinkCatalog. This change ensures that when Flink requests a 
table, it receives a DataCatalogTable that wraps a Paimon FileStoreTable 
configured with a proper CatalogEnvironment containing a valid catalogLoader.
   
   ### Why are the changes needed?
      Without this override, calling getTable() on the base catalog defaults to 
the Gravitino REST API, which returns a plain CatalogTable without the 
necessary Paimon-specific context.
   
     When Flink's AbstractFlinkTableFactory.buildPaimonTable() receives this 
plain table, it creates a FileStoreTable with CatalogEnvironment.empty() (where 
catalogLoader is null). Consequently, partitionHandler() returns null, the 
AddPartitionCommitCallback is never registered, and the Hive partition metadata 
is never updated after commits.
   
     This fix resolves the issue by ensuring the correct, context-rich Paimon 
table object is returned, enabling the partition update mechanism to function 
properly.
   
   
   ### Does this PR introduce any user-facing change?
     No. This is an internal fix that corrects the underlying behavior without 
altering any user-facing APIs or configuration properties. Users will now 
experience correct Hive partition updates when writing to Paimon partitioned 
tables via Flink.
   
   ### How was this patch tested?
     This patch was tested by adding comprehensive unit tests in 
TestGravitinoPaimonCatalog:
   
     Delegation Test: Verified that calls to getTable() and tableExists() are 
correctly delegated to the underlying Paimon FlinkCatalog.
   
     Exception Propagation Test: Ensured that exceptions thrown by the 
underlying catalog are properly propagated to the caller.
   
     Consistency Test: Confirmed that the behavior between getTable() and 
tableExists() remains consistent, preventing metadata mismatches.
   


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

Reply via email to