Github user Fokko commented on a diff in the pull request:
https://github.com/apache/spark/pull/22399#discussion_r219480345
--- Diff:
sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/CLIService.java
---
@@ -146,16 +146,11 @@ public UserGroupInformation getHttpUGI() {
public synchronized void start() {
super.start();
// Initialize and test a connection to the metastore
- IMetaStoreClient metastoreClient = null;
try {
- metastoreClient = new HiveMetaStoreClient(hiveConf);
- metastoreClient.getDatabases("default");
- } catch (Exception e) {
- throw new ServiceException("Unable to connect to MetaStore!", e);
- }
- finally {
- if (metastoreClient != null) {
- metastoreClient.close();
+ try (IMetaStoreClient metastoreClient = new
HiveMetaStoreClient(hiveConf)) {
--- End diff --
Good one, thanks
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]