You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by td...@apache.org on 2018/03/02 23:48:32 UTC

phoenix git commit: PHOENIX-4633 Handle the creation of SYSTEM.CATALOG correctly for users that don't have CREATE access on SYSTEM.CATALOG

Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 62a611690 -> 0f7879b17


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/0f7879b1
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0f7879b1
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0f7879b1

Branch: refs/heads/4.x-HBase-0.98
Commit: 0f7879b17f25c110c145ce449da918a80308b18e
Parents: 62a6116
Author: Thomas D'Silva <td...@apache.org>
Authored: Wed Feb 28 14:32:27 2018 -0800
Committer: Thomas D'Silva <td...@apache.org>
Committed: Fri Mar 2 15:48:23 2018 -0800

----------------------------------------------------------------------
 .../phoenix/query/ConnectionQueryServicesImpl.java  | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0f7879b1/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 01c862e..624544f 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;
@@ -2451,7 +2452,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());