You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by hy...@apache.org on 2015/08/14 16:30:03 UTC
[24/51] [partial] tajo git commit: TAJO-1761: Separate an integration
unit test kit into an independent module.
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin2.sql b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin2.sql
new file mode 100644
index 0000000..6c2d66a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin2.sql
@@ -0,0 +1,5 @@
+select a.l_orderkey, b.c_custkey, b.c_name, b.c_nationkey, d.n_name
+from lineitem a
+left outer join customer b on a.l_orderkey = b.c_custkey
+left outer join orders c on b.c_custkey = c.o_custkey
+left outer join nation d on a.l_orderkey = d.n_nationkey
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin3.sql b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin3.sql
new file mode 100644
index 0000000..ef6e490
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testLeftOuterJoin3.sql
@@ -0,0 +1,7 @@
+select a.c_custkey, a.c_name, a.c_nationkey, b.l_orderkey, c.o_orderdate, d.o_orderdate, e.n_name, f.p_name
+from customer a
+left outer join lineitem b on a.c_custkey = b.l_orderkey
+left outer join orders c on b.l_orderkey = c.o_orderkey
+left outer join orders d on a.c_custkey = d.o_orderkey
+left outer join nation e on d.o_orderkey = e.n_nationkey
+left outer join part f on f.p_partkey = d.o_orderkey
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength.sql b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength.sql
new file mode 100644
index 0000000..6ae6c09
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength.sql
@@ -0,0 +1,3 @@
+select * from customer a
+ left outer join nation_multifile b on a.c_nationkey = b.n_nationkey
+ where b.n_nationkey is null
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength2.sql b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength2.sql
new file mode 100644
index 0000000..e6dfba7
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestOuterJoinQuery/testMultipleBroadcastDataFileWithZeroLength2.sql
@@ -0,0 +1,5 @@
+select b.o_orderkey, b.o_orderdate, b.o_custkey, a.c_custkey, a.c_name, c.n_nationkey, c.n_name
+from customer a
+ left outer join orders b on a.c_custkey = b.o_custkey
+ left outer join nation_multifile c on a.c_nationkey = c.n_nationkey
+ where c.n_nationkey is not null
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_1.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_1.sql
new file mode 100644
index 0000000..7aa9439
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_1.sql
@@ -0,0 +1 @@
+select * from lineitem group by l_orderkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_2.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_2.sql
new file mode 100644
index 0000000..90b31b2
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/error_groupby_2.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem group by l_paerkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_casewhen_1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_casewhen_1.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_casewhen_1.sql
new file mode 100644
index 0000000..57b369b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_casewhen_1.sql
@@ -0,0 +1,15 @@
+SELECT
+ CASE
+ WHEN PERIOD < 0 THEN 'N/A'
+ WHEN PERIOD <= INTERVAL '12h' THEN 'C0'
+ WHEN PERIOD <= INTERVAL '24h' THEN 'C1'
+ WHEN PERIOD <= INTERVAL '48h' THEN 'C2'
+ ELSE 'XX'
+ END AS P
+FROM (
+ SELECT
+ INTERVAL '12h' as PERIOD,
+ L_ORDERKEY
+ FROM
+ LINEITEM
+) T;
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_limit_1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_limit_1.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_limit_1.sql
new file mode 100644
index 0000000..65c72b1
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_limit_1.sql
@@ -0,0 +1 @@
+select * from lineitem limit l_orderkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_store_format.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_store_format.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_store_format.sql
new file mode 100644
index 0000000..e5307d6
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/invalid_store_format.sql
@@ -0,0 +1 @@
+create table table1 (name text, age int) using RAW;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_groupby_1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_groupby_1.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_groupby_1.sql
new file mode 100644
index 0000000..90c2371
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_groupby_1.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem group by l_orderkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_limit_1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_limit_1.sql b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_limit_1.sql
new file mode 100644
index 0000000..79cf804
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestQueryValidation/valid_limit_1.sql
@@ -0,0 +1 @@
+select * from lineitem limit 3;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_1.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_1.sql
new file mode 100644
index 0000000..bdf76eb
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_1.sql
@@ -0,0 +1 @@
+CREATE TABLE T1 (A TEXT, B INT4, C RECORD (D TEXT, E INT8), F FLOAT8);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_2.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_2.sql
new file mode 100644
index 0000000..0bfdc11
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/create_table_nested_2.sql
@@ -0,0 +1 @@
+CREATE TABLE T1 (A TEXT, B INT4, C RECORD (D TEXT, E INT8, F RECORD (G INT1, H FLOAT4)), Z FLOAT8);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog1.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog1.sql
new file mode 100644
index 0000000..345531c
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog1.sql
@@ -0,0 +1 @@
+SET CATALOG tajo;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog2.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog2.sql
new file mode 100644
index 0000000..d2ef283
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setcatalog2.sql
@@ -0,0 +1 @@
+SET CATALOG "Mixed Letter";
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession1.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession1.sql
new file mode 100644
index 0000000..8efe696
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession1.sql
@@ -0,0 +1 @@
+SET SESSION ENABLE_SEQSCAN TO true;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession2.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession2.sql
new file mode 100644
index 0000000..458f1e5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession2.sql
@@ -0,0 +1 @@
+SET SESSION ENABLE_SEQSCAN TO false;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession3.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession3.sql
new file mode 100644
index 0000000..432d123
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession3.sql
@@ -0,0 +1 @@
+SET SESSION EXTSORT_BUFFER_SIZE TO 100;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession4.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession4.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession4.sql
new file mode 100644
index 0000000..a363702
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession4.sql
@@ -0,0 +1 @@
+SET SESSION EXTSORT_BUFFER_SIZE TO 50.7;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession5.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession5.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession5.sql
new file mode 100644
index 0000000..c9fcfc5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession5.sql
@@ -0,0 +1 @@
+SET SESSION EXTSORT_BUFFER_SIZE TO 'ABCD';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession6.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession6.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession6.sql
new file mode 100644
index 0000000..957232b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession6.sql
@@ -0,0 +1 @@
+SET SESSION EXTSORT_BUFFER_SIZE 'ABCD';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession7.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession7.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession7.sql
new file mode 100644
index 0000000..179428e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/setsession7.sql
@@ -0,0 +1 @@
+SET SESSION EXTSORT_BUFFER_SIZE = 'ABCD';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone1.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone1.sql
new file mode 100644
index 0000000..a86d255
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone1.sql
@@ -0,0 +1 @@
+SET TIME ZONE 'PDT';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone2.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone2.sql
new file mode 100644
index 0000000..85dae0f
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone2.sql
@@ -0,0 +1 @@
+SET TIME ZONE -7;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone3.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone3.sql
new file mode 100644
index 0000000..ef56b12
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/settimezone3.sql
@@ -0,0 +1 @@
+SET TIME ZONE DEFAULT;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window1.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window1.sql
new file mode 100644
index 0000000..52156b8
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window1.sql
@@ -0,0 +1,5 @@
+ SELECT
+ dt,
+ sum(xy) over()
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window2.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window2.sql
new file mode 100644
index 0000000..60f1fbf
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window2.sql
@@ -0,0 +1,5 @@
+ SELECT
+ dt,
+ sum(xy) over(partition by dt)
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window3.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window3.sql
new file mode 100644
index 0000000..01dd542
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window3.sql
@@ -0,0 +1,5 @@
+ SELECT
+ dt,
+ sum(xy) over(partition by round(dt))
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window4.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window4.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window4.sql
new file mode 100644
index 0000000..629d5e4
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window4.sql
@@ -0,0 +1,5 @@
+ SELECT
+ dt,
+ sum(xy) over(order by dt)
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window5.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window5.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window5.sql
new file mode 100644
index 0000000..6338817
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window5.sql
@@ -0,0 +1,6 @@
+ SELECT
+ dt,
+ dt2,
+ sum(xy) over(partition by round(dt),dt2 order by ceil(dt) asc null last)
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window6.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window6.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window6.sql
new file mode 100644
index 0000000..1f1870e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window6.sql
@@ -0,0 +1,6 @@
+ SELECT
+ dt,
+ dt2,
+ sum(xy) over(partition by round(dt),dt2 order by ceil(dt) asc null last ROWS UNBOUNDED PRECEDING)
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window7.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window7.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window7.sql
new file mode 100644
index 0000000..6daa806
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window7.sql
@@ -0,0 +1,6 @@
+ SELECT
+ dt,
+ dt2,
+ row_number() over(partition by round(dt),dt2 order by ceil(dt) asc null last ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window8.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window8.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window8.sql
new file mode 100644
index 0000000..6f70690
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window8.sql
@@ -0,0 +1,6 @@
+ SELECT
+ dt,
+ dt2,
+ row_number() over(partition by round(dt),dt2 order by ceil(dt) asc null last ROWS BETWEEN 1 PRECEDING AND CURRENT ROW)
+FROM
+ sum_example;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window9.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window9.sql b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window9.sql
new file mode 100644
index 0000000..b289ebf
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSQLAnalyzer/window9.sql
@@ -0,0 +1,9 @@
+ SELECT
+ dt,
+ dt2,
+ row_number() over(window1),
+ rank() over(window1)
+FROM
+ sum_example
+WINDOW
+ window1 AS (partition by round(dt),dt2 order by ceil(dt) asc null last ROWS BETWEEN 1 PRECEDING AND CURRENT ROW);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql
new file mode 100644
index 0000000..ed6aee1
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample0_ddl.sql
@@ -0,0 +1 @@
+CREATE TABLE clone (title TEXT, name RECORD (first_name TEXT, last_name TEXT)) USING JSON;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample1_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample1_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample1_ddl.sql
new file mode 100644
index 0000000..9ba5f8c
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample1_ddl.sql
@@ -0,0 +1,7 @@
+CREATE EXTERNAL TABLE ${0} (
+ title TEXT,
+ name RECORD (
+ first_name TEXT,
+ last_name TEXT
+ )
+) USING JSON LOCATION ${table.path};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample2_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample2_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample2_ddl.sql
new file mode 100644
index 0000000..bc2d6e2
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/sample2_ddl.sql
@@ -0,0 +1,23 @@
+CREATE EXTERNAL TABLE ${0} (
+ glossary RECORD (
+ title TEXT,
+ "GlossDiv" RECORD (
+ title TEXT,
+ "GlossList" RECORD (
+ "GlossEntry" RECORD (
+ "ID" TEXT,
+ "SortAs" TEXT,
+ "GlossTerm" TEXT,
+ "Acronym" TEXT,
+ "Abbrev" TEXT,
+ "GlossDef" RECORD (
+ para TEXT,
+ "GlossSeeAlso" TEXT
+ ),
+
+ "GlossSee" TEXT
+ )
+ )
+ )
+ )
+) USING JSON LOCATION ${table.path};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsGroupbyKey1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsGroupbyKey1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsGroupbyKey1.sql
new file mode 100644
index 0000000..c19e69e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsGroupbyKey1.sql
@@ -0,0 +1,9 @@
+SELECT
+ user.name,
+ sum(retweet_count) as total_retweet
+FROM
+ tweets
+GROUP BY
+ user.name
+order by
+ user.name;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsJoinKey1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsJoinKey1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsJoinKey1.sql
new file mode 100644
index 0000000..336840e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testNestedFieldAsJoinKey1.sql
@@ -0,0 +1,7 @@
+SELECT
+ t1.user.id,
+ t1.user.name,
+ t2.user.id,
+ t2.user.name
+FROM
+ tweets t1 join tweets t2 ON t1.user.id = t2.user.id
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql
new file mode 100644
index 0000000..a594bcf
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect0.sql
@@ -0,0 +1 @@
+SELECT title, name.first_name, name.last_name FROM sample1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect1.sql
new file mode 100644
index 0000000..b099e77
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect1.sql
@@ -0,0 +1 @@
+SELECT title, (name.first_name || ' ' || name.last_name) as full_name FROM sample1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect2.sql
new file mode 100644
index 0000000..9993a4e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect2.sql
@@ -0,0 +1,61 @@
+SELECT
+ coordinates,
+ favorited,
+ truncated,
+ created_at,
+ id_str,
+ in_reply_to_user_id_str,
+ contributors,
+ "text",
+ metadata.iso_language_code,
+ metadata.result_type,
+ retweet_count,
+ in_reply_to_status_id_str,
+ id,
+ geo,
+ retweeted,
+ in_reply_to_user_id,
+ place,
+ user.profile_sidebar_fill_color,
+ user.profile_sidebar_border_color,
+ user.profile_background_tile,
+ user.name,
+ user.profile_image_url,
+ user.created_at,
+ user.location,
+ user.follow_request_sent,
+ user.profile_link_color,
+ user.is_translator,
+ user.id_str,
+ user.default_profile,
+ user.contributors_enabled,
+ user.favourites_count,
+ user.url,
+ user.profile_image_url_https,
+ user.utc_offset,
+ user.id,
+ user.profile_use_background_image,
+ user.listed_count,
+ user.profile_text_color,
+ user.lang,
+ user.followers_count,
+ user.protected,
+ user.notifications,
+ user.profile_background_image_url_https,
+ user.profile_background_color,
+ user.verified,
+ user.geo_enabled,
+ user.time_zone,
+ user.description,
+ user.default_profile_image,
+ user.profile_background_image_url,
+ user.statuses_count,
+ user.friends_count,
+ user.following,
+ user.show_all_inline_media,
+ user.screen_name,
+ in_reply_to_screen_name,
+ source,
+ in_reply_to_status_id
+FROM
+ tweets;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect3.sql
new file mode 100644
index 0000000..dfc79e9
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/testSelect3.sql
@@ -0,0 +1 @@
+select glossary.title, glossary."GlossDiv"."title" from sample5;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/tweets_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/tweets_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/tweets_ddl.sql
new file mode 100644
index 0000000..e750095
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectNestedRecord/tweets_ddl.sql
@@ -0,0 +1,74 @@
+CREATE EXTERNAL TABLE IF NOT EXISTS ${0} (
+ coordinates TEXT,
+ favorited BOOL,
+ truncated BOOL,
+ created_at TIMESTAMP,
+ id_str TEXT,
+ /*entrities RECORD ( -- when we support array, we should remove this comment.
+ urls ARRAY<TEXT>
+ )*/
+ in_reply_to_user_id_str TEXT,
+ contributors TEXT,
+ text TEXT,
+ metadata RECORD (
+ iso_language_code TEXT,
+ result_type TEXT
+ ),
+ retweet_count INTEGER,
+ in_reply_to_status_id_str TEXT,
+ id TEXT,
+ geo TEXT,
+ retweeted BOOL,
+ in_reply_to_user_id TEXT,
+ place TEXT,
+ user RECORD (
+ profile_sidebar_fill_color TEXT,
+ profile_sidebar_border_color TEXT,
+ profile_background_tile TEXT,
+ name TEXT,
+ profile_image_url TEXT,
+ created_at TIMESTAMP,
+ location TEXT,
+ follow_request_sent TEXT,
+ profile_link_color TEXT,
+ is_translator BOOL,
+ id_str TEXT,
+ /* -- when we support array, we should fill the following comments.
+ entities RECORD (
+ url RECORD (
+ ),
+ description RECORD (
+ )
+ ), */
+ default_profile BOOL,
+ contributors_enabled BOOL,
+ favourites_count INTEGER,
+ url TEXT,
+ profile_image_url_https TEXT,
+ utc_offset INTEGER,
+ id BIGINT,
+ profile_use_background_image BOOL,
+ listed_count INTEGER,
+ profile_text_color TEXT,
+ lang TEXT,
+ followers_count INTEGER,
+ protected BOOL,
+ notifications TEXT,
+ profile_background_image_url_https TEXT,
+ profile_background_color TEXT,
+ verified TEXT,
+ geo_enabled TEXT,
+ time_zone TEXT,
+ description TEXT,
+ default_profile_image TEXT,
+ profile_background_image_url TEXT,
+ statuses_count INTEGER,
+ friends_count INTEGER,
+ following TEXT,
+ show_all_inline_media BOOL,
+ screen_name TEXT
+ ),
+ in_reply_to_screen_name TEXT,
+ source TEXT,
+ in_reply_to_status_id TEXT
+) USING JSON LOCATION ${table.path};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/customer_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/customer_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/customer_ddl.sql
new file mode 100644
index 0000000..ca43710
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/customer_ddl.sql
@@ -0,0 +1,9 @@
+CREATE TABLE customer_parts (
+ c_custkey INT4,
+ c_name TEXT,
+ c_address TEXT,
+ c_phone TEXT,
+ c_acctbal FLOAT8,
+ c_mktsegment TEXT,
+ c_comment TEXT
+) PARTITION BY COLUMN (c_nationkey INT4);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_ddl.sql
new file mode 100644
index 0000000..d2c97c5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_ddl.sql
@@ -0,0 +1,4 @@
+CREATE EXTERNAL TABLE ${0} (
+ t_timestamp TIMESTAMP,
+ t_date DATE
+) USING TEXT LOCATION ${table.path}
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_timezoned_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_timezoned_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_timezoned_ddl.sql
new file mode 100644
index 0000000..131e619
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/datetime_table_timezoned_ddl.sql
@@ -0,0 +1,4 @@
+CREATE EXTERNAL TABLE ${0} (
+ t_timestamp TIMESTAMP,
+ t_date DATE
+) USING TEXT WITH ('timezone' = 'GMT+9') LOCATION ${table.path}
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/insert_into_customer.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/insert_into_customer.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/insert_into_customer.sql
new file mode 100644
index 0000000..8767ba4
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/insert_into_customer.sql
@@ -0,0 +1,11 @@
+INSERT INTO customer_parts
+ SELECT
+ c_custkey,
+ c_name,
+ c_address,
+ c_phone,
+ c_acctbal,
+ c_mktsegment,
+ c_comment,
+ c_nationkey
+ FROM customer;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table1_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table1_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table1_ddl.sql
new file mode 100644
index 0000000..8309d11
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table1_ddl.sql
@@ -0,0 +1,3 @@
+create external table table1 (id int, name text, score float, type text) using text
+with ('text.delimiter'='||', 'text.null'='NULL') location ${table.path};
+
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table2_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table2_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table2_ddl.sql
new file mode 100644
index 0000000..2fb821a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table2_ddl.sql
@@ -0,0 +1,3 @@
+create external table table2 (id int, name text, score float, type text) using text
+with ('text.delimiter'='ㅎ', 'text.null'='NULL') location ${table.path};
+
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table3_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table3_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table3_ddl.sql
new file mode 100644
index 0000000..8309d11
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table3_ddl.sql
@@ -0,0 +1,3 @@
+create external table table1 (id int, name text, score float, type text) using text
+with ('text.delimiter'='||', 'text.null'='NULL') location ${table.path};
+
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table4_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table4_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table4_ddl.sql
new file mode 100644
index 0000000..2fb821a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/multibytes_delimiter_table4_ddl.sql
@@ -0,0 +1,3 @@
+create external table table2 (id int, name text, score float, type text) using text
+with ('text.delimiter'='ㅎ', 'text.null'='NULL') location ${table.path};
+
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhen.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhen.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhen.sql
new file mode 100644
index 0000000..20e8190
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhen.sql
@@ -0,0 +1,11 @@
+select
+ r_regionkey,
+ case
+ when r_regionkey = 1 then 'one'
+ when r_regionkey = 2 then 'two'
+ when r_regionkey = 3 then 'three'
+ when r_regionkey = 4 then 'four'
+ else 'zero'
+ end as cond
+from
+ region;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenRound.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenRound.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenRound.sql
new file mode 100644
index 0000000..cee905a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenRound.sql
@@ -0,0 +1,8 @@
+select *
+ from (select n_nationkey as key,
+ case when n_nationkey > 6 then round((n_nationkey * 100 / 2.123) / (n_regionkey * 50 / 2.123), 2) else 100.0 end as val
+ from nation
+ where n_regionkey > 0
+ and n_nationkey > 0
+ ) a
+order by a.key
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenWithoutElse.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenWithoutElse.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenWithoutElse.sql
new file mode 100644
index 0000000..279d3fd
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCaseWhenWithoutElse.sql
@@ -0,0 +1,10 @@
+select
+ r_regionkey,
+ case
+ when r_regionkey = 1 then 10 + r_regionkey
+ when r_regionkey = 2 then 10 + r_regionkey
+ when r_regionkey = 3 then 10 + r_regionkey
+ when r_regionkey = 4 then 10 + r_regionkey
+ end as cond
+from
+ region;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition1.sql
new file mode 100644
index 0000000..f47d21c
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition1.sql
@@ -0,0 +1,7 @@
+SELECT
+ L_ORDERKEY,
+ L_PARTKEY
+FROM
+ LINEITEM
+WHERE
+ L_ORDERKEY > L_PARTKEY;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition2.sql
new file mode 100644
index 0000000..dd153d5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testColumnEqualityButNotJoinCondition2.sql
@@ -0,0 +1,7 @@
+SELECT
+ SUBSTR(L_ORDERKEY::TEXT,1,1),
+ SUBSTR(L_PARTKEY::TEXT,1,1)
+ FROM
+ LINEITEM
+ WHERE
+ SUBSTR(L_ORDERKEY::TEXT,1,1) = SUBSTR(L_PARTKEY::TEXT,1,1);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCreateAfterSelect.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCreateAfterSelect.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCreateAfterSelect.sql
new file mode 100644
index 0000000..2bc4be9
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testCreateAfterSelect.sql
@@ -0,0 +1 @@
+create table orderkeys as select l_orderkey from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef1.sql
new file mode 100644
index 0000000..a483758
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef1.sql
@@ -0,0 +1 @@
+SELECT L_ORDERKEY FROM "TestSelectQuery"."LineItem";
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef2.sql
new file mode 100644
index 0000000..6abc3f9
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef2.sql
@@ -0,0 +1 @@
+SELECT "LineItem".L_ORDERKEY FROM "TestSelectQuery"."LineItem";
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef3.sql
new file mode 100644
index 0000000..3fded5f
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testDatabaseRef3.sql
@@ -0,0 +1 @@
+SELECT "TestSelectQuery"."LineItem".L_ORDERKEY FROM "TestSelectQuery"."LineItem";
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testExplainSelect.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testExplainSelect.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testExplainSelect.sql
new file mode 100644
index 0000000..4d4f32c
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testExplainSelect.sql
@@ -0,0 +1 @@
+explain select l_orderkey, l_partkey from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInClause.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInClause.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInClause.sql
new file mode 100644
index 0000000..406fd31
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInClause.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem where l_partkey in (2,3);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInStrClause.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInStrClause.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInStrClause.sql
new file mode 100644
index 0000000..8a4f426
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testInStrClause.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem where l_returnflag in ('R', 'S');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLikeClause.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLikeClause.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLikeClause.sql
new file mode 100644
index 0000000..b173aa1
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLikeClause.sql
@@ -0,0 +1 @@
+SELECT n_name FROM nation WHERE n_name LIKE '%IA';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLimit.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLimit.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLimit.sql
new file mode 100644
index 0000000..6e74de5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testLimit.sql
@@ -0,0 +1 @@
+select l_orderkey, l_suppkey from lineitem limit 3;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter1.sql
new file mode 100644
index 0000000..bd6b02d
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter1.sql
@@ -0,0 +1 @@
+select * from table1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter2.sql
new file mode 100644
index 0000000..66a69ec
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter2.sql
@@ -0,0 +1 @@
+select * from table2;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter3.sql
new file mode 100644
index 0000000..bd6b02d
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter3.sql
@@ -0,0 +1 @@
+select * from table1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter4.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter4.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter4.sql
new file mode 100644
index 0000000..66a69ec
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testMultiBytesDelimiter4.sql
@@ -0,0 +1 @@
+select * from table2;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNestedPythonFunction.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNestedPythonFunction.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNestedPythonFunction.sql
new file mode 100644
index 0000000..02b2059
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNestedPythonFunction.sql
@@ -0,0 +1 @@
+select * from nation where add_py(n_regionkey, return_one()) < 2
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonFromSelect1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonFromSelect1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonFromSelect1.sql
new file mode 100644
index 0000000..ca0ef7a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonFromSelect1.sql
@@ -0,0 +1 @@
+select upper('abc');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonQualifiedNames.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonQualifiedNames.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonQualifiedNames.sql
new file mode 100644
index 0000000..0c176b7
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNonQualifiedNames.sql
@@ -0,0 +1 @@
+select l_orderkey, l_partkey from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotEqual.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotEqual.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotEqual.sql
new file mode 100644
index 0000000..ccd6a9f
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotEqual.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem where l_orderkey != 1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInClause.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInClause.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInClause.sql
new file mode 100644
index 0000000..1e9ea93
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInClause.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem where l_partkey not in (2,3);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInStrClause.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInStrClause.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInStrClause.sql
new file mode 100644
index 0000000..8e38750
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testNotInStrClause.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem where l_returnflag not in ('N', 'S');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testRealValueCompare.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testRealValueCompare.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testRealValueCompare.sql
new file mode 100644
index 0000000..589b51b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testRealValueCompare.sql
@@ -0,0 +1 @@
+select ps_supplycost from partsupp where ps_supplycost = 771.64;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect.sql
new file mode 100644
index 0000000..0c176b7
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect.sql
@@ -0,0 +1 @@
+select l_orderkey, l_partkey from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect2.sql
new file mode 100644
index 0000000..3bc28da
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect2.sql
@@ -0,0 +1 @@
+select l_orderkey, l_partkey, l_orderkey + l_partkey as plus from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect3.sql
new file mode 100644
index 0000000..1c85f59
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelect3.sql
@@ -0,0 +1 @@
+select l_orderkey + l_partkey as plus from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterik.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterik.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterik.sql
new file mode 100644
index 0000000..cda515b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterik.sql
@@ -0,0 +1 @@
+select * from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk1.sql
new file mode 100644
index 0000000..cda515b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk1.sql
@@ -0,0 +1 @@
+select * from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk2.sql
new file mode 100644
index 0000000..71da1f1
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk2.sql
@@ -0,0 +1 @@
+select * from lineitem where l_orderkey = 2;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk3.sql
new file mode 100644
index 0000000..4d75b08
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk3.sql
@@ -0,0 +1 @@
+select * from lineitem where l_orderkey % 2 = 0;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk4.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk4.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk4.sql
new file mode 100644
index 0000000..71580c8
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk4.sql
@@ -0,0 +1 @@
+select length(l_comment), l_extendedprice * l_discount, *, l_tax * 10 from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk5.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk5.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk5.sql
new file mode 100644
index 0000000..d538eb8
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectAsterisk5.sql
@@ -0,0 +1 @@
+select * from (select l_orderkey, 1 from lineitem where l_orderkey % 2 = 0) t1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAlias1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAlias1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAlias1.sql
new file mode 100644
index 0000000..a9ce4a2
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAlias1.sql
@@ -0,0 +1 @@
+select l_orderkey as col1, l_orderkey + 1 as col2 from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation1.sql
new file mode 100644
index 0000000..91170e3
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation1.sql
@@ -0,0 +1 @@
+select (l_orderkey + l_orderkey) l_orderkey from lineitem where l_orderkey > 2;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation2.sql
new file mode 100644
index 0000000..89f63fd
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation2.sql
@@ -0,0 +1 @@
+select (-l_orderkey) as l_orderkey from lineitem order by l_orderkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation3.sql
new file mode 100644
index 0000000..98336b7
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectColumnAliasExistingInRelation3.sql
@@ -0,0 +1,19 @@
+SELECT l_orderkey FROM (
+
+-- actual test query
+ SELECT
+ T1.l_orderkey
+ FROM
+ LINEITEM
+ INNER JOIN (
+ SELECT
+ T1.l_orderkey
+ FROM (
+ SELECT
+ LINEITEM.l_orderkey AS l_orderkey
+ FROM
+ LINEITEM
+ ) T1
+ ) T1 ON LINEITEM.l_orderkey=T1.l_orderkey
+
+) A ORDER BY l_orderkey; -- for determinant query result
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectDistinct.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectDistinct.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectDistinct.sql
new file mode 100644
index 0000000..224e181
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectDistinct.sql
@@ -0,0 +1,7 @@
+select
+ l_orderkey, l_linenumber
+from (
+ select distinct l_orderkey, l_linenumber from lineitem
+) table1
+order by
+ l_orderkey, l_linenumber;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectOnSessionTable.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectOnSessionTable.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectOnSessionTable.sql
new file mode 100644
index 0000000..a953751
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectOnSessionTable.sql
@@ -0,0 +1 @@
+select * from information_schema.session where name = 'CURRENT_DATABASE';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectPythonFuncs.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectPythonFuncs.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectPythonFuncs.sql
new file mode 100644
index 0000000..5ae0d5e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectPythonFuncs.sql
@@ -0,0 +1,2 @@
+select helloworld(), add_py(n_nationkey, n_regionkey) as sum, concat_py(n_name) as concat
+from nation where n_nationkey < 5
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.sql
new file mode 100644
index 0000000..baf21ea
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases.sql
@@ -0,0 +1 @@
+select l_orderkey, '20130819' as date1, '20130819' as date2 from lineitem where l_orderkey > -1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases2.sql
new file mode 100644
index 0000000..fecabd5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases2.sql
@@ -0,0 +1 @@
+select l_orderkey, '20130819' as date1, '20130819' as date2, '20130819' as date3, '20130819' as date4 from lineitem where l_orderkey > -1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameConstantsWithDifferentAliases3.sql
new file mode 100644
index 0000000..ec03a11
--- /dev/null
+++ b/tajo-core-tests/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/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameExprsWithDifferentAliases.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameExprsWithDifferentAliases.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameExprsWithDifferentAliases.sql
new file mode 100644
index 0000000..52d2c1a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectSameExprsWithDifferentAliases.sql
@@ -0,0 +1 @@
+select l_orderkey, l_partkey + 1 as plus1, l_partkey + 1 as plus2 from lineitem where l_orderkey > -1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithJson.json
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithJson.json b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithJson.json
new file mode 100644
index 0000000..bf89ab5
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithJson.json
@@ -0,0 +1,74 @@
+// select l_orderkey, l_partkey + 1 as plus1, l_partkey + 1 as plus2 from lineitem where l_orderkey > -1;
+{
+ "IsDistinct": false,
+ "Projections": [
+ {
+ "Expr": {
+ "ColumnName": "l_orderkey",
+ "OpType": "Column"
+ },
+ "OpType": "Target"
+ },
+ {
+ "AliasName": "plus1",
+ "Expr": {
+ "LeftExpr": {
+ "ColumnName": "l_partkey",
+ "OpType": "Column"
+ },
+ "RightExpr": {
+ "Value": "1",
+ "ValueType": "Unsigned_Integer",
+ "OpType": "Literal"
+ },
+ "OpType": "Plus"
+ },
+ "OpType": "Target"
+ },
+ {
+ "AliasName": "plus2",
+ "Expr": {
+ "LeftExpr": {
+ "ColumnName": "l_partkey",
+ "OpType": "Column"
+ },
+ "RightExpr": {
+ "Value": "1",
+ "ValueType": "Unsigned_Integer",
+ "OpType": "Literal"
+ },
+ "OpType": "Plus"
+ },
+ "OpType": "Target"
+ }
+ ],
+ "Expr": {
+ "SelectCondition": {
+ "LeftExpr": {
+ "ColumnName": "l_orderkey",
+ "OpType": "Column"
+ },
+ "RightExpr": {
+ "IsNegative": true,
+ "Expr": {
+ "Value": "1",
+ "ValueType": "Unsigned_Integer",
+ "OpType": "Literal"
+ },
+ "OpType": "Sign"
+ },
+ "OpType": "GreaterThan"
+ },
+ "Expr": {
+ "Relations": [
+ {
+ "TableName": "lineitem",
+ "OpType": "Relation"
+ }
+ ],
+ "OpType": "RelationList"
+ },
+ "OpType": "Filter"
+ },
+ "OpType": "Projection"
+}
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses1.sql
new file mode 100644
index 0000000..24f5e3b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses1.sql
@@ -0,0 +1 @@
+(select n_nationkey, n_name from nation where n_nationkey = 1);
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses2.sql
new file mode 100644
index 0000000..e707a8c
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithParentheses2.sql
@@ -0,0 +1 @@
+(select n1.n_nationkey, n2.n_name from nation n1 join nation n2 on n1.n_nationkey = n2.n_nationkey where n1.n_nationkey = 1);
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithPredicateOnPythonFunc.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithPredicateOnPythonFunc.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithPredicateOnPythonFunc.sql
new file mode 100644
index 0000000..aa9feba
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSelectWithPredicateOnPythonFunc.sql
@@ -0,0 +1 @@
+select * from nation where add_py(n_regionkey,1) > 2
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQuery.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQuery.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQuery.sql
new file mode 100644
index 0000000..cda515b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQuery.sql
@@ -0,0 +1 @@
+select * from lineitem;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimit.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimit.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimit.sql
new file mode 100644
index 0000000..79cf804
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimit.sql
@@ -0,0 +1 @@
+select * from lineitem limit 3;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimitPartitionedTable.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimitPartitionedTable.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimitPartitionedTable.sql
new file mode 100644
index 0000000..42362b6
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSimpleQueryWithLimitPartitionedTable.sql
@@ -0,0 +1 @@
+select * from customer_parts limit 10;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testStringCompare.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testStringCompare.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testStringCompare.sql
new file mode 100644
index 0000000..7f4a672
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testStringCompare.sql
@@ -0,0 +1 @@
+select l_orderkey from lineitem where l_shipdate <= '1996-03-22';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumFloatOverflow.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumFloatOverflow.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumFloatOverflow.sql
new file mode 100644
index 0000000..9ec941a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumFloatOverflow.sql
@@ -0,0 +1 @@
+select sum(cast(L_EXTENDEDPRICE * 3.21506374375027E33 as FLOAT8)) from lineitem where l_quantity > 0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumIntOverflow.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumIntOverflow.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumIntOverflow.sql
new file mode 100644
index 0000000..96421eb
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testSumIntOverflow.sql
@@ -0,0 +1 @@
+select sum(cast(l_quantity * 25264513 as INT4)) from lineitem where l_quantity > 0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable1.sql
new file mode 100644
index 0000000..38c9e90
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable1.sql
@@ -0,0 +1 @@
+SELECT * FROM timezoned1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable2.sql
new file mode 100644
index 0000000..1fd9e36
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable2.sql
@@ -0,0 +1,2 @@
+SET TIME ZONE 'GMT';
+SELECT * FROM timezoned2;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable3.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable3.sql
new file mode 100644
index 0000000..32b9c3a
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable3.sql
@@ -0,0 +1 @@
+SELECT * FROM timezoned3;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable4.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable4.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable4.sql
new file mode 100644
index 0000000..acd096b
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable4.sql
@@ -0,0 +1,2 @@
+SET TIME ZONE 'GMT+9';
+SELECT * FROM timezoned4;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable5.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable5.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable5.sql
new file mode 100644
index 0000000..13894ce
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testTimezonedTable5.sql
@@ -0,0 +1,2 @@
+SET SESSION TIMEZONE = 'GMT+9';
+SELECT * FROM timezoned5;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond1.sql
new file mode 100644
index 0000000..cb44aed
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond1.sql
@@ -0,0 +1 @@
+select l_orderkey + l_partkey as plus from lineitem where plus = 4;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond2.sql
new file mode 100644
index 0000000..7fa0d18
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCond2.sql
@@ -0,0 +1,9 @@
+select *
+from (
+ select a.l_orderkey, count(*) as cnt, sum(l_extendedprice) as sum1
+ from lineitem a
+ group by a.l_orderkey
+ having sum1 > 70000
+) t
+where t.cnt > 1
+order by t.l_orderkey
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias1.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias1.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias1.sql
new file mode 100644
index 0000000..e758dfd
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias1.sql
@@ -0,0 +1 @@
+select l_orderkey as orderkey, l_partkey from lineitem where orderkey = 1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias2.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias2.sql b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias2.sql
new file mode 100644
index 0000000..566ea2d
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSelectQuery/testWhereCondWithAlias2.sql
@@ -0,0 +1 @@
+select l_orderkey as orderkey from lineitem where l_orderkey = 1;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_asc_desc_keys.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_asc_desc_keys.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_asc_desc_keys.sql
new file mode 100644
index 0000000..936e5ed
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_asc_desc_keys.sql
@@ -0,0 +1 @@
+create external table table2 (col1 int8, col2 int8) using text with ('text.delimiter'=',') location ${table.path};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_date_ddl.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_date_ddl.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_date_ddl.sql
new file mode 100644
index 0000000..3ba63e0
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/create_table_with_date_ddl.sql
@@ -0,0 +1,10 @@
+-- Sort Table
+-- It is used in TestSortQuery::testSortWithDate
+
+create external table testSortWithDate (
+ col1 timestamp,
+ col2 date,
+ col3 time
+) using text
+with ('text.delimiter'='|', 'text.null'='NULL')
+location ${table.path};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/testAsterisk.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/testAsterisk.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testAsterisk.sql
new file mode 100644
index 0000000..e88ca43
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testAsterisk.sql
@@ -0,0 +1 @@
+select *, length(l_comment) as len_comment from lineitem order by len_comment;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSort.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSort.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSort.sql
new file mode 100644
index 0000000..7958002
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSort.sql
@@ -0,0 +1 @@
+select l_linenumber, l_orderkey from lineitem order by l_orderkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupby.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupby.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupby.sql
new file mode 100644
index 0000000..81a1d8e
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupby.sql
@@ -0,0 +1 @@
+select max(l_quantity) as maxq, l_orderkey from lineitem group by l_orderkey order by l_orderkey;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupbyWithAlias.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupbyWithAlias.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupbyWithAlias.sql
new file mode 100644
index 0000000..a167e76
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortAfterGroupbyWithAlias.sql
@@ -0,0 +1 @@
+select max(l_quantity) as max_quantity, l_orderkey from lineitem group by l_orderkey order by max_quantity;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortDesc.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortDesc.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortDesc.sql
new file mode 100644
index 0000000..4252643
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortDesc.sql
@@ -0,0 +1 @@
+select l_linenumber, l_orderkey from lineitem order by l_orderkey desc;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tajo/blob/a4106883/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortFirstDesc.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortFirstDesc.sql b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortFirstDesc.sql
new file mode 100644
index 0000000..644feb0
--- /dev/null
+++ b/tajo-core-tests/src/test/resources/queries/TestSortQuery/testSortFirstDesc.sql
@@ -0,0 +1 @@
+select col1, col2 from sortfirstdesc order by col1 desc, col2;
\ No newline at end of file