Repository: tajo Updated Branches: refs/heads/master bb482d8ee -> 7e31a3201
http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java index 5528b21..09c8bf3 100644 --- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java +++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java @@ -166,6 +166,15 @@ public class TestSelectQuery extends QueryTestCaseBase { } @Test + public final void testSelectSameConstantsWithDifferentAliases3() throws Exception { + // select l_orderkey, '20130819' as date1, '20130819', '20130819', '20130819' + // from lineitem where l_orderkey > -1; + ResultSet res = executeQuery(); + assertResultSet(res); + cleanupQuery(res); + } + + @Test public final void testSelectSameExprsWithDifferentAliases() throws Exception { // select l_orderkey, l_partkey + 1 as plus1, l_partkey + 1 as plus2 from lineitem where l_orderkey > -1; ResultSet res = executeQuery(); @@ -451,7 +460,7 @@ public class TestSelectQuery extends QueryTestCaseBase { while (res.next()) { String currentNowValue = res.getString(1); if (nowValue != null) { - assertTrue(nowValue.equals(currentNowValue)); + assertTrue(nowValue + " is different to " + currentNowValue, nowValue.equals(currentNowValue)); } nowValue = currentNowValue; numRecords++; http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java index c7f6406..7d2c5d2 100644 --- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java +++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestSortQuery.java @@ -218,4 +218,21 @@ public class TestSortQuery extends QueryTestCaseBase { executeString("DROP TABLE nullsort PURGE;").close(); } } + + @Test + public final void testSortWithConstKeys() throws Exception { + // select + // l_orderkey, + // l_linenumber, + // 1 as key1, + // 2 as key2 + // from + // lineitem + // order by + // key1, + // key2; + ResultSet res = executeQuery(); + assertResultSet(res); + cleanupQuery(res); + } } http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/java/org/apache/tajo/engine/query/TestWindowQuery.java ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestWindowQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestWindowQuery.java index d202153..d64dd20 100644 --- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestWindowQuery.java +++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestWindowQuery.java @@ -83,6 +83,13 @@ public class TestWindowQuery extends QueryTestCaseBase { } @Test + public final void testWindow8() throws Exception { + ResultSet res = executeQuery(); + assertResultSet(res); + cleanupQuery(res); + } + + @Test public final void testWindowWithOrderBy1() throws Exception { ResultSet res = executeQuery(); assertResultSet(res); http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys3.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys3.sql b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys3.sql new file mode 100644 index 0000000..568009d --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys3.sql @@ -0,0 +1,8 @@ +select + timestamp '2014-07-07 04:28:31.561' as b, + '##' as c, + count(*) d +from + lineitem +group by + b, c; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys4.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys4.sql b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys4.sql new file mode 100644 index 0000000..4de4dda --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys4.sql @@ -0,0 +1,12 @@ +select + 'day', + l_orderkey, + count(*) as sum +from + lineitem +group by + 'day', + l_orderkey +order by + 'day', + l_orderkey; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys5.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys5.sql b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys5.sql new file mode 100644 index 0000000..4132d37 --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestGroupByQuery/testGroupByWithConstantKeys5.sql @@ -0,0 +1,13 @@ +select + 'day', + 'day' as key, + l_orderkey, + count(*) as sum +from + lineitem +group by + 'day', + l_orderkey +order by + 'day', + l_orderkey; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.sql b/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.sql new file mode 100644 index 0000000..9e3838d --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.sql @@ -0,0 +1,6 @@ +SELECT + l.l_orderkey, + o.o_orderkey, + '201405' as key1, + '5-LOW' as key2 +from lineitem l left outer join orders o on l.l_orderkey = o.o_orderkey and o_orderpriority = '5-LOW'; http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.sql b/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.sql new file mode 100644 index 0000000..720a004 --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.sql @@ -0,0 +1,9 @@ +SELECT + l.l_orderkey, + o.o_orderkey, + '201405' as key1, + '5-LOW' as key2 +from + lineitem l left outer join orders o on l.l_orderkey = o.o_orderkey +WHERE + o_orderpriority = '5-LOW' http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql b/tajo-core/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql new file mode 100644 index 0000000..ec03a11 --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql @@ -0,0 +1,10 @@ +select + l_orderkey, + '20130819' as date1, + '20130819', + '20130819', + '20130819' +from + lineitem +where + l_orderkey > -1; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestSortQuery/testSortWithConstKeys.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestSortQuery/testSortWithConstKeys.sql b/tajo-core/src/test/resources/queries/TestSortQuery/testSortWithConstKeys.sql new file mode 100644 index 0000000..ddaf84f --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestSortQuery/testSortWithConstKeys.sql @@ -0,0 +1,10 @@ +select + l_orderkey, + l_linenumber, + 1 as key1, + 2 as key2 +from + lineitem +order by + key1, + key2; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/queries/TestWindowQuery/testWindow8.sql ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/queries/TestWindowQuery/testWindow8.sql b/tajo-core/src/test/resources/queries/TestWindowQuery/testWindow8.sql new file mode 100644 index 0000000..4611bee --- /dev/null +++ b/tajo-core/src/test/resources/queries/TestWindowQuery/testWindow8.sql @@ -0,0 +1,7 @@ +select + l_orderkey, + l_quantity, + rank() over (partition by l_orderkey) as r, + 5 as const_val +from + lineitem; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys3.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys3.result b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys3.result new file mode 100644 index 0000000..3285621 --- /dev/null +++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys3.result @@ -0,0 +1,3 @@ +b,c,d +------------------------------- +2014-07-07 04:28:31.561,##,5 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys4.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys4.result b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys4.result new file mode 100644 index 0000000..69560d5 --- /dev/null +++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys4.result @@ -0,0 +1,5 @@ +?text,l_orderkey,sum +------------------------------- +day,1,2 +day,2,1 +day,3,2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys5.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys5.result b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys5.result new file mode 100644 index 0000000..30ba1de --- /dev/null +++ b/tajo-core/src/test/resources/results/TestGroupByQuery/testGroupByWithConstantKeys5.result @@ -0,0 +1,5 @@ +?text,key,l_orderkey,sum +------------------------------- +day,day,1,2 +day,day,2,1 +day,day,3,2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.result b/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.result new file mode 100644 index 0000000..cb1c3fc --- /dev/null +++ b/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr4.result @@ -0,0 +1,7 @@ +l_orderkey,o_orderkey,key1,key2 +------------------------------- +1,1,201405,5-LOW +1,1,201405,5-LOW +2,null,201405,5-LOW +3,3,201405,5-LOW +3,3,201405,5-LOW \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.result b/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.result new file mode 100644 index 0000000..8ba8bba --- /dev/null +++ b/tajo-core/src/test/resources/results/TestJoinQuery/testLeftOuterJoinWithConstantExpr5.result @@ -0,0 +1,6 @@ +l_orderkey,o_orderkey,key1,key2 +------------------------------- +1,1,201405,5-LOW +1,1,201405,5-LOW +3,3,201405,5-LOW +3,3,201405,5-LOW \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result b/tajo-core/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result index 6fc2ceb..2eb0399 100644 --- a/tajo-core/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result +++ b/tajo-core/src/test/resources/results/TestSelectQuery/testSelectAsterisk5.result @@ -1,3 +1,3 @@ -l_orderkey,?literal +l_orderkey,?number ------------------------------- 2,1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.result b/tajo-core/src/test/resources/results/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.result new file mode 100644 index 0000000..909f4b9 --- /dev/null +++ b/tajo-core/src/test/resources/results/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.result @@ -0,0 +1,7 @@ +l_orderkey,date1,?text,?text_1,?text_2 +------------------------------- +1,20130819,20130819,20130819,20130819 +1,20130819,20130819,20130819,20130819 +2,20130819,20130819,20130819,20130819 +3,20130819,20130819,20130819,20130819 +3,20130819,20130819,20130819,20130819 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestSortQuery/testSortWithConstKeys.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestSortQuery/testSortWithConstKeys.result b/tajo-core/src/test/resources/results/TestSortQuery/testSortWithConstKeys.result new file mode 100644 index 0000000..bfc709f --- /dev/null +++ b/tajo-core/src/test/resources/results/TestSortQuery/testSortWithConstKeys.result @@ -0,0 +1,7 @@ +l_orderkey,l_linenumber,key1,key2 +------------------------------- +1,1,1,2 +1,2,1,2 +2,1,1,2 +3,1,1,2 +3,2,1,2 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestTajoCli/testLocalQueryWithoutFrom.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestTajoCli/testLocalQueryWithoutFrom.result b/tajo-core/src/test/resources/results/TestTajoCli/testLocalQueryWithoutFrom.result index bf51d16..7d3718f 100644 --- a/tajo-core/src/test/resources/results/TestTajoCli/testLocalQueryWithoutFrom.result +++ b/tajo-core/src/test/resources/results/TestTajoCli/testLocalQueryWithoutFrom.result @@ -1,8 +1,8 @@ -?literal, ?literal_1 +?text, ?text_1 ------------------------------- abc, 123 (1 rows, , 0 B selected) ?substr ------------------------------- 123 -(1 rows, , 0 B selected) +(1 rows, , 0 B selected) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tajo/blob/7e31a320/tajo-core/src/test/resources/results/TestWindowQuery/testWindow8.result ---------------------------------------------------------------------- diff --git a/tajo-core/src/test/resources/results/TestWindowQuery/testWindow8.result b/tajo-core/src/test/resources/results/TestWindowQuery/testWindow8.result new file mode 100644 index 0000000..f371de5 --- /dev/null +++ b/tajo-core/src/test/resources/results/TestWindowQuery/testWindow8.result @@ -0,0 +1,7 @@ +l_orderkey,l_quantity,r,const_val +------------------------------- +1,17.0,1,5 +1,36.0,1,5 +2,38.0,1,5 +3,45.0,1,5 +3,49.0,1,5 \ No newline at end of file
