drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject drill git commit: DRILL-3189: Disable disallow partial in Over-Clause
Date Mon, 13 Jul 2015 18:52:29 GMT
Repository: drill
Updated Branches:
  refs/heads/master a2fc406c0 -> 7edddd65e


DRILL-3189: Disable disallow partial in Over-Clause


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

Branch: refs/heads/master
Commit: 7edddd65e9850a35f3cca6d226c98ea354dd40c4
Parents: a2fc406
Author: Hsuan-Yi Chu <hsuanyi@usc.edu>
Authored: Mon Jul 6 13:49:22 2015 -0700
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Mon Jul 13 11:41:27 2015 -0700

----------------------------------------------------------------------
 .../sql/parser/UnsupportedOperatorsVisitor.java      |  8 ++++++++
 .../org/apache/drill/exec/TestWindowFunctions.java   | 15 +++++++++++++++
 2 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/7edddd65/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 9bbd537..17689ad 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
@@ -212,6 +212,14 @@ public class UnsupportedOperatorsVisitor extends SqlShuttle {
             "See Apache Drill JIRA: DRILL-3188");
         throw new UnsupportedOperationException();
       }
+
+      // DRILL-3189: Disable DISALLOW PARTIAL
+      if(!window.isAllowPartial()) {
+        unsupportedOperatorCollector.setException(SqlUnsupportedException.ExceptionType.FUNCTION,
+            "Disallowing partial windows is currently not supported \n" +
+            "See Apache Drill JIRA: DRILL-3189");
+        throw new UnsupportedOperationException();
+      }
     }
 
     // Disable unsupported Intersect, Except

http://git-wip-us.apache.org/repos/asf/drill/blob/7edddd65/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java b/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
index 7071bea..222c7b7 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/TestWindowFunctions.java
@@ -225,6 +225,21 @@ public class TestWindowFunctions extends BaseTestQuery {
     }
   }
 
+  @Test(expected = UnsupportedFunctionException.class) // DRILL-3189
+  public void testWindowWithAllowDisallow() throws Exception {
+    try {
+      final String query = "select sum(n_nationKey) over(partition by n_nationKey \n" +
+          "rows between unbounded preceding and unbounded following disallow partial) \n"
+
+          "from cp.`tpch/nation.parquet` \n" +
+          "order by n_nationKey";
+
+      test(query);
+    } catch(UserException ex) {
+      throwAsUnsupportedException(ex);
+      throw ex;
+    }
+  }
+
   @Test // DRILL-3344
   public void testWindowGroupBy() throws Exception {
     String query = "explain plan for SELECT max(n_nationkey) OVER (), n_name as col2 \n"
+


Mime
View raw message