DRILL-773: Add test for aggregate function with drill custom function
The actual fix is in Optiq.


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

Branch: refs/heads/master
Commit: ba4d1a6dd3448d115709e9f8548fba2a25eef10b
Parents: b900be2
Author: Mehant Baid <[email protected]>
Authored: Tue Jun 10 13:14:11 2014 -0700
Committer: Jacques Nadeau <[email protected]>
Committed: Wed Jun 11 09:03:24 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/jdbc/test/TestJdbcQuery.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/ba4d1a6d/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java
----------------------------------------------------------------------
diff --git 
a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java 
b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java
index 1b83148..a2438a1 100644
--- a/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java
+++ b/exec/jdbc/src/test/java/org/apache/drill/jdbc/test/TestJdbcQuery.java
@@ -391,4 +391,15 @@ public class TestJdbcQuery extends JdbcTest{
             "employee_id=101; EXPR$1=Test\n"
         );
   }
+
+  @Test
+  public void testAggWithDrillFunc() throws Exception {
+    JdbcAssert.withNoDefaultSchema()
+        .sql("SELECT extract(year from max(to_timestamp(hire_date, 'yyyy-MM-dd 
HH:mm:SS.SSS' ))) as MAX_YEAR " +
+            "from cp.`employee.json` ")
+        .returns(
+            "MAX_YEAR=1998\n"
+        );
+  }
+
 }

Reply via email to