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

   ### What changes were proposed in this pull request?
   
   Add two protected, default-compatible JDBC extension points: a load overload 
accepting a request-local metadata builder enricher, and a no-op pre-ALTER 
target validator after SQL generation but before borrowing the execution 
connection.
   
   ### Why are the changes needed?
   
   Connectors combining JDBC with another metadata source otherwise duplicate 
the common loader or perform repeated reads. Backend object-kind checks need a 
safe place after local ALTER validation without copying the execution flow.
   
   Fixes #14504
   
   ### Does this PR introduce _any_ user-facing change?
   
   No existing connector is opted in. Standard load preserves the original 
hooks and ordering. An explicit enricher replaces 
partitioning/properties/field-correction hooks, retains JDBC 
columns/indexes/distribution, and may override builder fields. It runs with a 
borrowed open connection, must not close/retain it, and is not retained across 
calls. Runtime errors propagate after connection cleanup.
   
   The target hook may reject ALTER with a runtime exception; it performs no 
DDL. SQL-generation failures and empty SQL skip it. SQL generation itself may 
borrow connections. This is not an atomic check against out-of-band 
replacement, does not guard rename/create/drop, and does not make 
JDBC/other-source snapshots atomic. Downstream opt-in implementations need 
their own integration review.
   
   ### How was this patch tested?
   
   - Full JDBC common non-Docker suite: 130 tests, no failures; Spotless and 
RAT passed.
   - Real SQLite tests cover callback request isolation, connection open inside 
callbacks and closed afterwards/on failure, default-hook restoration, retained 
JDBC/distribution work and failure identity.
   - Target-ordering tests assert local validation/empty-SQL handling and no 
execution connection on rejection; existing connection-usage tests cover 
default successful ALTER.
   - Disabling enrichment/target validation makes all three new regressions 
fail; the restored full suite passes.
   - Fresh-context review passed. No external connector or cross-backend 
integration test was run; this PR introduces no production opt-in caller.
   


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