You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pv...@apache.org on 2019/09/19 10:22:18 UTC

[hive] branch branch-3.1 updated: HIVE-21508: ClassCastException when initializing HiveMetaStoreClient on JDK10 or newer (Ana Jalba, via Peter Vary)

This is an automated email from the ASF dual-hosted git repository.

pvary pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 93f2274  HIVE-21508: ClassCastException when initializing HiveMetaStoreClient on JDK10 or newer (Ana Jalba, via Peter Vary)
93f2274 is described below

commit 93f2274b5ddce0454f5fcaef605823618c5d9c77
Author: Peter Vary <pv...@cloudera.com>
AuthorDate: Thu Sep 19 12:21:53 2019 +0200

    HIVE-21508: ClassCastException when initializing HiveMetaStoreClient on JDK10 or newer (Ana Jalba, via Peter Vary)
---
 .../java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
index 2a14dd4..d3a108c 100644
--- a/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
+++ b/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java
@@ -257,9 +257,9 @@ public class HiveMetaStoreClient implements IMetaStoreClient, AutoCloseable {
       }
 
       if (MetastoreConf.getVar(conf, ConfVars.THRIFT_URI_SELECTION).equalsIgnoreCase("RANDOM")) {
-        List uriList = Arrays.asList(metastoreUris);
+        List<URI> uriList = Arrays.asList(metastoreUris);
         Collections.shuffle(uriList);
-        metastoreUris = (URI[]) uriList.toArray();
+        metastoreUris = uriList.toArray(new URI[uriList.size()]);
       }
     } catch (IllegalArgumentException e) {
       throw (e);