Repository: phoenix Updated Branches: refs/heads/master a35591c87 -> 2b7861536
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/2b786153 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/2b786153 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/2b786153 Branch: refs/heads/master Commit: 2b7861536909a51167bcd5006eb70f65f03d9536 Parents: a35591c Author: Thomas D'Silva <tdsi...@apache.org> Authored: Wed Feb 28 14:32:27 2018 -0800 Committer: Thomas D'Silva <tdsi...@apache.org> Committed: Fri Mar 2 15:52:07 2018 -0800 ---------------------------------------------------------------------- .../phoenix/query/ConnectionQueryServicesImpl.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/2b786153/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());