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

   ### What changes were proposed in this pull request?
   
   Add an optional `SupportsTableIdentifier` connector SPI and use it for 
existence checks on already imported external tables. Hive 2 and Hive 3 read 
the live table type and Gravitino identifier with one raw metastore table 
lookup, without column conversion, SerDe field resolution or column-constraint 
RPCs.
   
   The dispatcher keeps the ordinary load/import path for cold tables, changed 
or malformed identifiers, managed catalogs and connectors without the SPI. 
Missing source objects return false; metastore failures propagate. No existence 
result is cached across requests.
   
   ### Why are the changes needed?
   
   Privilege operations validate their target object. Repeated grants/revokes 
across roles currently load full metadata for an unchanged Hive table on every 
validation, including column and registration-refresh work. An imported table 
with the same live source identity can be checked without that work. The fix 
preserves first-import and identity-conflict handling instead of replacing 
those checks with an unconditional boolean probe.
   
   Fixes #15141
   
   ### Does this PR introduce _any_ user-facing change?
   
   Adds an optional Java connector SPI. Existing connectors retain the 
load-based fallback. No REST API or configuration changes. Explicit table loads 
still refresh the full metadata.
   
   ### How was this patch tested?
   
   - Reproduced the original dispatcher's full `loadTable` call in a focused 
regression before applying the dispatcher fix.
   - 180 tests passed across `TestTableOperationDispatcher`, 
`TestMetadataObjectUtil`, `TestHiveShimGetTable`, `TestHiveShimV3` and 
`TestHiveCatalogOperations`.
   - Tests cover imported/cold tables, unchanged/absent/changed/malformed 
identifiers, missing source tables/schemas, source failures and views. Hive 
probe tests assert that only the raw get-table RPC is issued.
   - Spotless checks and API Javadoc generation passed.
   - Docker/live-Hive integration tests were not run locally; metastore RPC 
behavior is verified with mocked Hive 2/3 clients.
   
   Commands (JDK 17):
   
   ```bash
   ./gradlew :api:javadoc \
     :core:coreUnitTest \
     --tests org.apache.gravitino.catalog.TestTableOperationDispatcher \
     --tests org.apache.gravitino.utils.TestMetadataObjectUtil \
     :catalogs:hive-metastore-common:test \
     --tests org.apache.gravitino.hive.client.TestHiveShimGetTable \
     :catalogs:hive-metastore3-libs:test \
     --tests org.apache.gravitino.hive.client.hive3.TestHiveShimV3 \
     :catalogs:catalog-hive:test \
     --tests org.apache.gravitino.catalog.hive.TestHiveCatalogOperations \
     -PskipITs -PskipDockerTests=true
   ```
   


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