tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [03/19] git commit: TAJO-913: Add some missed tests for constant value group-by keys.
Date Tue, 15 Jul 2014 07:16:42 GMT
TAJO-913: Add some missed tests for constant value group-by keys.

Closes #60


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/52c8600d
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/52c8600d
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/52c8600d

Branch: refs/heads/index_support
Commit: 52c8600dd59247b9be95f338ade4ea5aee2fba06
Parents: 29db645
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Fri Jul 11 14:30:38 2014 +0900
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Fri Jul 11 14:30:38 2014 +0900

----------------------------------------------------------------------
 CHANGES                                            |  3 +++
 .../apache/tajo/engine/query/TestGroupByQuery.java | 17 +++++++++++++++++
 .../testGroupByWithConstantKeys2.sql               |  1 +
 .../testGroupByWithConstantKeys1.result            |  3 +++
 .../testGroupByWithConstantKeys2.result            |  5 +++++
 5 files changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/52c8600d/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f73bf1b..563d64e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -81,6 +81,9 @@ Release 0.9.0 - unreleased
     (Hyoungjun Kim via hyunsik)
 
   BUG FIXES
+ 
+    TAJO-913: Add some missed tests for constant value group-by keys. 
+    (hyunsik)
 
     TAJO-909: {SortBased, Col}PartitionStoreExec should not write partition 
     keys to files. (Hyoungjun Kim via hyunsik)

http://git-wip-us.apache.org/repos/asf/tajo/blob/52c8600d/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
index 9f06317..40ee54e 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestGroupByQuery.java
@@ -139,6 +139,23 @@ public class TestGroupByQuery extends QueryTestCaseBase {
   }
 
   @Test
+  public final void testGroupByWithConstantKeys1() throws Exception {
+    // select 123 as key, count(1) as total from lineitem group by key order by key, total;
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
+  public final void testGroupByWithConstantKeys2() throws Exception {
+    // select l_partkey as a, timestamp '2014-07-07 04:28:31.561' as b, '##' as c, count(*)
d from lineitem
+    // group by a, b, c;
+    ResultSet res = executeQuery();
+    assertResultSet(res);
+    cleanupQuery(res);
+  }
+
+  @Test
   public final void testDistinctAggregation1() throws Exception {
     // select l_orderkey, max(l_orderkey) as maximum, count(distinct l_linenumber) as unique_key
from lineitem
     // group by l_orderkey;

http://git-wip-us.apache.org/repos/asf/tajo/blob/52c8600d/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys2.sql
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys2.sql
b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys2.sql
new file mode 100644
index 0000000..439d049
--- /dev/null
+++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys2.sql
@@ -0,0 +1 @@
+select l_partkey as a, timestamp '2014-07-07 04:28:31.561' as b, '##' as c, count(*) d from
lineitem group by a, b, c;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/52c8600d/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys1.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys1.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys1.result
new file mode 100644
index 0000000..2c04315
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys1.result
@@ -0,0 +1,3 @@
+key,total
+-------------------------------
+123,5
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/52c8600d/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys2.result
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys2.result
b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys2.result
new file mode 100644
index 0000000..e2a3b89
--- /dev/null
+++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys2.result
@@ -0,0 +1,5 @@
+a,b,c,d
+-------------------------------
+3,2014-07-07 04:28:31.561,##,1
+1,2014-07-07 04:28:31.561,##,2
+2,2014-07-07 04:28:31.561,##,2
\ No newline at end of file


Mime
View raw message