drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansi...@apache.org
Subject [2/2] drill git commit: DRILL-1888: Added unit test for HAVING clause on aggregate expression. Fix is common with DRILL-2063.
Date Mon, 26 Jan 2015 07:55:25 GMT
DRILL-1888: Added unit test for HAVING clause on aggregate expression.  Fix is common with
DRILL-2063.


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

Branch: refs/heads/master
Commit: 3c6d0ef6595810a0a6b15e48da25fb268ccf2b36
Parents: 52b36ed
Author: Aman Sinha <asinha@maprtech.com>
Authored: Sat Jan 24 16:53:34 2015 -0800
Committer: Aman Sinha <asinha@maprtech.com>
Committed: Sat Jan 24 16:53:34 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/drill/TestExampleQueries.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/3c6d0ef6/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
index 8f04657..dffa0a6 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
@@ -533,4 +533,20 @@ public class TestExampleQueries extends BaseTestQuery{
     .build().run();
 
   }
+
+  @Test // DRILL-1888
+  public void testAggExpressionWithGroupByHaving() throws Exception {
+    String query = "select l_suppkey, sum(l_extendedprice)/sum(l_quantity) as avg_price \n"
+
+        " from cp.`tpch/lineitem.parquet` where l_orderkey in \n" +
+        " (select o_orderkey from cp.`tpch/orders.parquet` where o_custkey = 2) \n" +
+        " group by l_suppkey having sum(l_extendedprice)/sum(l_quantity) > 1850.0";
+
+    testBuilder()
+    .sqlQuery(query)
+    .ordered()
+    .baselineColumns("l_suppkey", "avg_price")
+    .baselineValues(98, 1854.95)
+    .build().run();
+  }
+
 }


Mime
View raw message