From commits-return-19714-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Sat Mar 3 00:51:38 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 39AA818062F for ; Sat, 3 Mar 2018 00:51:38 +0100 (CET) Received: (qmail 61308 invoked by uid 500); 2 Mar 2018 23:51:37 -0000 Mailing-List: contact commits-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list commits@phoenix.apache.org Received: (qmail 61298 invoked by uid 99); 2 Mar 2018 23:51:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2018 23:51:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1F3C5F4DC5; Fri, 2 Mar 2018 23:51:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tdsilva@apache.org To: commits@phoenix.apache.org Message-Id: <234a1818deff4920bfe8f6e956cc26cc@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: phoenix git commit: PHOENIX-4633 Handle the creation of SYSTEM.CATALOG correctly for users that don't have CREATE access on SYSTEM.CATALOG Date: Fri, 2 Mar 2018 23:51:37 +0000 (UTC) Repository: phoenix Updated Branches: refs/heads/4.x-cdh5.11.2 1da8e8608 -> ca5c9d03c PHOENIX-4633 Handle the creation of SYSTEM.CATALOG correctly for users that don't have CREATE access on SYSTEM.CATALOG Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/ca5c9d03 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/ca5c9d03 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/ca5c9d03 Branch: refs/heads/4.x-cdh5.11.2 Commit: ca5c9d03ceb619f6b8fcb3f443907a0ccf0b9cd0 Parents: 1da8e86 Author: Thomas D'Silva Authored: Wed Feb 28 14:32:27 2018 -0800 Committer: Thomas D'Silva Committed: Fri Mar 2 15:51:33 2018 -0800 ---------------------------------------------------------------------- .../phoenix/query/ConnectionQueryServicesImpl.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/ca5c9d03/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java index 6926c4e..6bff885 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java @@ -129,6 +129,7 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.util.VersionInfo; import org.apache.hadoop.hbase.zookeeper.ZKConfig; +import org.apache.hadoop.ipc.RemoteException; import org.apache.phoenix.compile.MutationPlan; import org.apache.phoenix.coprocessor.GroupedAggregateRegionObserver; import org.apache.phoenix.coprocessor.MetaDataEndpointImpl; @@ -2449,7 +2450,20 @@ public class ConnectionQueryServicesImpl extends DelegateQueryServices implement setUpgradeRequired(); } } catch (PhoenixIOException e) { - if (!Iterables.isEmpty(Iterables.filter(Throwables.getCausalChain(e), AccessDeniedException.class))) { + boolean foundAccessDeniedException = false; + // when running spark/map reduce jobs the ADE might be wrapped + // in a RemoteException + for (Throwable t : Throwables.getCausalChain(e)) { + if (t instanceof AccessDeniedException + || (t instanceof RemoteException + && ((RemoteException) t).getClassName() + .equals(AccessDeniedException.class + .getName()))) { + foundAccessDeniedException = true; + break; + } + } + if (foundAccessDeniedException) { // Pass logger.warn("Could not check for Phoenix SYSTEM tables, assuming they exist and are properly configured"); checkClientServerCompatibility(SchemaUtil.getPhysicalName(SYSTEM_CATALOG_NAME_BYTES, getProps()).getName());