jlalwani-amazon opened a new pull request, #6462: URL: https://github.com/apache/hive/pull/6462
## Problem `HiveClientCache` (used by HCatalog's `HCatInputFormat`/`HCatOutputFormat`) hardcodes `HiveMetaStoreClient` in two places: 1. `getNonCachedHiveMetastoreClient()` calls `RetryingMetaStoreClient.getProxy(hiveConf, true)` which hardcodes `HiveMetaStoreClient.class.getName()` 2. `CacheableHiveMetaStoreClient extends HiveMetaStoreClient` — only works with the Thrift client This means any custom `IMetaStoreClient` implementation configured via `hive.metastore.client.impl` (e.g., AWS Glue Data Catalog client) is ignored when accessing Hive tables through HCatalog. The main Hive path (`Hive.java` → `HiveMetaStoreClientBuilder`) already respects this config, but HCatalog bypasses it entirely. ## Fix 1. `getNonCachedHiveMetastoreClient()` now reads the class name from `MetastoreConf.ConfVars.METASTORE_CLIENT_IMPL` and passes it to `RetryingMetaStoreClient.getProxy()`. Retry behavior is preserved. 2. `CacheableHiveMetaStoreClient` refactored from `extends HiveMetaStoreClient` to `implements InvocationHandler`. It wraps any `IMetaStoreClient` via `Proxy.newProxyInstance`, delegating metastore calls to the underlying client while managing cache lifecycle (acquire/release/teardown). 3. `ICacheableMetaStoreClient` changed from `extends IMetaStoreClient` to `extends Closeable` since the proxy handles `IMetaStoreClient`. 4. `invoke()` unwraps `InvocationTargetException` so callers see the real exception. ## Testing `mvn test -pl metastore -Dtest=TestHiveClientCache -Drat.skip=true -am` — 5/5 pass, 0 failures. ## JIRA https://issues.apache.org/jira/browse/HIVE-12679 -- 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]
