drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject drill git commit: DRILL-5704: Improve error message on client side when queries fail with "Failed to create schema tree." when Impersonation is enabled and logins are anonymous
Date Wed, 23 Aug 2017 17:33:51 GMT
Repository: drill
Updated Branches:
  refs/heads/master e9065b55e -> 0641dedcd


DRILL-5704: Improve error message on client side when queries fail with "Failed to create
schema tree." when Impersonation is enabled and logins are anonymous


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/0641dedc
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/0641dedc
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/0641dedc

Branch: refs/heads/master
Commit: 0641dedcde60cb56bd02069aae43dc657e98cc8c
Parents: e9065b5
Author: Sorabh Hamirwasia <shamirwasia@maprtech.com>
Authored: Thu Aug 3 18:23:02 2017 -0700
Committer: Parth Chandra <parthc@apache.org>
Committed: Mon Aug 21 09:49:22 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/store/SchemaTreeProvider.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/0641dedc/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
index 5a8bfb2..23441bd 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/SchemaTreeProvider.java
@@ -112,9 +112,16 @@ public class SchemaTreeProvider implements AutoCloseable {
       return rootSchema;
     } catch(IOException e) {
       // We can't proceed further without a schema, throw a runtime exception.
+      // Improve the error message for client side.
+
+      final String contextString = isImpersonationEnabled ? "[Hint: Username is absent in
connection URL or doesn't " +
+          "exist on Drillbit node. Please specify a username in connection URL which is present
on Drillbit node.]" :
+          "";
       throw UserException
           .resourceError(e)
           .message("Failed to create schema tree.")
+          .addContext("IOException: ", e.getMessage())
+          .addContext(contextString)
           .build(logger);
     }
   }


Mime
View raw message