drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [2/3] drill git commit: DRILL-2414: Give proper error message if Union-All is applied on schema-less tables
Date Tue, 17 Mar 2015 18:29:32 GMT
 DRILL-2414: Give proper error message if Union-All is applied on schema-less tables


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

Branch: refs/heads/master
Commit: 63bd48eb0a8081e3c24a7e49095bbcfc0f36bf7c
Parents: d11d5d9
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Mon Mar 9 22:50:59 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Tue Mar 17 11:07:55 2015 -0700

----------------------------------------------------------------------
 .../exception/UnsupportedOperatorCollector.java   | 14 ++++++--------
 .../planner/logical/PreProcessLogicalRel.java     |  6 ++++--
 .../sql/parser/UnsupportedOperatorsVisitor.java   | 18 ++++++++++++------
 3 files changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/63bd48eb/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
index 1a01d1d..de2df83 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/exception/UnsupportedOperatorCollector.java
@@ -24,7 +24,6 @@ import org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException;
 
 public class UnsupportedOperatorCollector {
   private SqlUnsupportedException.ExceptionType exceptionType;
-  private String jiraNumber;
   private String message;
 
   public UnsupportedOperatorCollector() {
@@ -35,13 +34,13 @@ public class UnsupportedOperatorCollector {
     switch (exceptionType) {
       case RELATIONAL:
         clean();
-        throw new UnsupportedRelOperatorException(jiraNumber, message);
+        throw new UnsupportedRelOperatorException(message);
       case DATA_TYPE:
         clean();
-        throw new UnsupportedDataTypeException(jiraNumber, message);
+        throw new UnsupportedDataTypeException(message);
       case FUNCTION:
         clean();
-        throw new UnsupportedFunctionException(jiraNumber, message);
+        throw new UnsupportedFunctionException(message);
       default:
         break;
     }
@@ -49,21 +48,20 @@ public class UnsupportedOperatorCollector {
     return false;
   }
 
-  public void setException(SqlUnsupportedException.ExceptionType exceptionType, String jiraNumber,
String message) {
+  public void setException(SqlUnsupportedException.ExceptionType exceptionType, String message)
{
     if(this.exceptionType != SqlUnsupportedException.ExceptionType.NONE) {
       throw new IllegalStateException("Exception was set already");
     }
 
     this.exceptionType = exceptionType;
-    this.jiraNumber = jiraNumber;
     this.message = message;
   }
 
   public void setException(SqlUnsupportedException.ExceptionType exceptionType) {
-    setException(exceptionType, "", "");
+    setException(exceptionType, "");
   }
 
-   public void clean() {
+  public void clean() {
       exceptionType = SqlUnsupportedException.ExceptionType.NONE;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/drill/blob/63bd48eb/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java
index a421861..9e76611 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/PreProcessLogicalRel.java
@@ -82,7 +82,8 @@ public class PreProcessLogicalRel extends RelShuttleImpl {
     for(AggregateCall aggregateCall : aggregate.getAggCallList()) {
       if(aggregateCall.getAggregation() instanceof SqlSingleValueAggFunction) {
         unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.FUNCTION,
-            "1937", "Non-scalar sub-query used in an expression");
+            "Non-scalar sub-query used in an expression\n" +
+            "See Apache Drill JIRA: DRILL-1937");
         throw new UnsupportedOperationException();
       }
     }
@@ -147,7 +148,8 @@ public class PreProcessLogicalRel extends RelShuttleImpl {
       for(RelDataTypeField dataField : child.getRowType().getFieldList()) {
         if(dataField.getName().contains(StarColumnHelper.STAR_COLUMN)) {
           unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
-            "2414", "Union-all over schema-less tables must specify the columns explicitly");
+              "Union-All over schema-less tables must specify the columns explicitly\n" +
+              "See Apache Drill JIRA: DRILL-2414");
           throw new UnsupportedOperationException();
         }
       }

http://git-wip-us.apache.org/repos/asf/drill/blob/63bd48eb/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
index 2504280..46fb925 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/UnsupportedOperatorsVisitor.java
@@ -67,7 +67,8 @@ public class UnsupportedOperatorsVisitor extends SqlShuttle {
     for(String strType : disabledType) {
       if(type.getTypeName().getSimple().equalsIgnoreCase(strType)) {
         unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.DATA_TYPE,
-            "1959", type.getTypeName().getSimple());
+            type.getTypeName().getSimple() + " is not supported\n" +
+            "See Apache Drill JIRA: DRILL-1959");
         throw new UnsupportedOperationException();
       }
     }
@@ -80,7 +81,8 @@ public class UnsupportedOperatorsVisitor extends SqlShuttle {
     // Disable unsupported Intersect, Except
     if(sqlCall.getKind() == SqlKind.INTERSECT || sqlCall.getKind() == SqlKind.EXCEPT) {
       unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
-          "1921", sqlCall.getOperator().getName());
+          sqlCall.getOperator().getName() + " is not supported\n" +
+          "See Apache Drill JIRA: DRILL-1921");
       throw new UnsupportedOperationException();
     }
 
@@ -89,7 +91,8 @@ public class UnsupportedOperatorsVisitor extends SqlShuttle {
       SqlSetOperator op = (SqlSetOperator) sqlCall.getOperator();
       if(!op.isAll()) {
         unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
-            "1921", sqlCall.getOperator().getName());
+            sqlCall.getOperator().getName() + " is not supported\n" +
+            "See Apache Drill JIRA: DRILL-1921");
         throw new UnsupportedOperationException();
       }
     }
@@ -101,14 +104,16 @@ public class UnsupportedOperatorsVisitor extends SqlShuttle {
       // Block Natural Join
       if(join.isNatural()) {
         unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
-            "1986", "NATURAL " + sqlCall.getOperator().getName());
+            "NATURAL JOIN is not supported\n" +
+            "See Apache Drill JIRA: DRILL-1986");
         throw new UnsupportedOperationException();
       }
 
       // Block Cross Join
       if(join.getJoinType() == JoinType.CROSS) {
         unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.RELATIONAL,
-            "1921", "CROSS " + sqlCall.getOperator().getName());
+            "CROSS JOIN is not supported\n" +
+            "See Apache Drill JIRA: DRILL-1921");
         throw new UnsupportedOperationException();
       }
     }
@@ -117,7 +122,8 @@ public class UnsupportedOperatorsVisitor extends SqlShuttle {
     for(String strOperator : disabledOperators) {
       if(sqlCall.getOperator().isName(strOperator)) {
         unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.FUNCTION,
-            "2115", sqlCall.getOperator().getName());
+            sqlCall.getOperator().getName() + " is not supported\n" +
+            "See Apache Drill JIRA: DRILL-2115");
         throw new UnsupportedOperationException();
       }
     }


Mime
View raw message