drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [1/2] drill git commit: DRILL-2229: For SqlParseException, SqlUnsupportedException, throw UserException
Date Wed, 13 May 2015 07:19:36 GMT
Repository: drill
Updated Branches:
  refs/heads/master 4199e6bb3 -> 880dff8e2


DRILL-2229: For SqlParseException, SqlUnsupportedException, throw UserException


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

Branch: refs/heads/master
Commit: 880dff8e2679871267a776c03d0dd72d9893a309
Parents: ce3343f
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Sun May 3 10:29:47 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Tue May 12 22:26:36 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/880dff8e/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
index 6961ee6..e385600 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlWorker.java
@@ -61,6 +61,7 @@ import org.apache.calcite.plan.hep.HepProgramBuilder;
 import org.apache.calcite.sql.SqlNode;
 import org.apache.calcite.sql.parser.SqlParseException;
 import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.drill.exec.work.foreman.SqlUnsupportedException;
 import org.apache.hadoop.security.AccessControlException;
 
 public class DrillSqlWorker {
@@ -143,7 +144,7 @@ public class DrillSqlWorker {
       injector.injectChecked(context.getExecutionControls(), "sql-parsing", ForemanSetupException.class);
       sqlNode = planner.parse(sql);
     } catch (SqlParseException e) {
-      throw new QueryInputException("Failure parsing SQL. " + e.getMessage(), e);
+      throw UserException.parseError(e).build();
     }
 
     AbstractSqlHandler handler;
@@ -179,6 +180,9 @@ public class DrillSqlWorker {
       throw UserException.parseError(e).message(errorMessage).build();
     } catch (AccessControlException e) {
       throw UserException.permissionError(e).build();
+    } catch(SqlUnsupportedException e) {
+      throw UserException.unsupportedError(e)
+          .build();
     } catch (IOException | RelConversionException e) {
       throw new QueryInputException("Failure handling SQL.", e);
     }


Mime
View raw message