From issues-return-165885-archive-asf-public=cust-asf.ponee.io@hive.apache.org Thu Sep 5 10:14:04 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6F31D180677 for ; Thu, 5 Sep 2019 12:14:04 +0200 (CEST) Received: (qmail 63444 invoked by uid 500); 5 Sep 2019 18:01:15 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 63413 invoked by uid 99); 5 Sep 2019 18:01:15 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2019 18:01:15 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 122D1E3144 for ; Thu, 5 Sep 2019 10:14:03 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id DBD1C78231C for ; Thu, 5 Sep 2019 10:14:00 +0000 (UTC) Date: Thu, 5 Sep 2019 10:14:00 +0000 (UTC) From: "Ana Jalba (Jira)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-21508) ClassCastException when initializing HiveMetaStoreClient on JDK10 or newer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-21508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ana Jalba updated HIVE-21508: ----------------------------- Status: In Progress (was: Patch Available) > ClassCastException when initializing HiveMetaStoreClient on JDK10 or newer > -------------------------------------------------------------------------- > > Key: HIVE-21508 > URL: https://issues.apache.org/jira/browse/HIVE-21508 > Project: Hive > Issue Type: Bug > Components: Clients > Affects Versions: 2.3.4, 3.2.0 > Reporter: Adar Dembo > Assignee: Ana Jalba > Priority: Major > Fix For: 2.4.0, 3.2.0, 2.3.7 > > Attachments: HIVE-21508.patch > > > There's this block of code in {{HiveMetaStoreClient:resolveUris}} (called from the constructor) on master: > {noformat} > private URI metastoreUris[]; > ... > if (MetastoreConf.getVar(conf, ConfVars.THRIFT_URI_SELECTION).equalsIgnoreCase("RANDOM")) { > List uriList = Arrays.asList(metastoreUris); > Collections.shuffle(uriList); > metastoreUris = (URI[]) uriList.toArray(); > } > {noformat} > The cast to {{URI[]}} throws a {{ClassCastException}} beginning with JDK 10, possibly with JDK 9 as well. Note that {{THRIFT_URI_SELECTION}} defaults to {{RANDOM}} so this should affect anyone who creates a {{HiveMetaStoreClient}}. On master this can be overridden with {{SEQUENTIAL}} to avoid the broken case; I'm working against 2.3.4 where there's no such workaround. > [Here's|https://stackoverflow.com/questions/51372788/array-cast-java-8-vs-java-9] a StackOverflow post that explains the issue in more detail. Interestingly, the author described the issue in the context of the HMS; not sure why there was no follow up with a Hive bug report. -- This message was sent by Atlassian Jira (v8.3.2#803003)