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 2013/10/14 17:36:37 UTC
git commit: TAJO-251: Rename the legacy name *.tql to *.sql. (hyunsik)
Updated Branches:
refs/heads/master 683aaf4f0 -> 0bea1fddd
TAJO-251: Rename the legacy name *.tql to *.sql. (hyunsik)
Project: http://git-wip-us.apache.org/repos/asf/incubator-tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tajo/commit/0bea1fdd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tajo/tree/0bea1fdd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tajo/diff/0bea1fdd
Branch: refs/heads/master
Commit: 0bea1fddd930ebf50e132f155e0e41d58199ee58
Parents: 683aaf4
Author: Hyunsik Choi <hy...@apache.org>
Authored: Tue Oct 15 00:32:48 2013 +0900
Committer: Hyunsik Choi <hy...@apache.org>
Committed: Tue Oct 15 00:32:48 2013 +0900
----------------------------------------------------------------------
CHANGES.txt | 2 +
pom.xml | 1 -
.../benchmark/simple/groupby1.sql | 6 +++
.../benchmark/simple/groupby1.tql | 6 ---
.../benchmark/simple/groupby2.sql | 6 +++
.../benchmark/simple/groupby2.tql | 6 ---
.../benchmark/simple/selection1.sql | 5 +++
.../benchmark/simple/selection1.tql | 5 ---
.../benchmark/simple/selection2.sql | 5 +++
.../benchmark/simple/selection2.tql | 5 ---
.../benchmark/simple/selection3.sql | 7 ++++
.../benchmark/simple/selection3.tql | 7 ----
.../tajo-core-backend/benchmark/tpch/q1.sql | 21 +++++++++++
.../tajo-core-backend/benchmark/tpch/q1.tql | 21 -----------
.../tajo-core-backend/benchmark/tpch/q10.sql | 31 ++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q10.tql | 31 ----------------
.../tajo-core-backend/benchmark/tpch/q11.sql | 27 ++++++++++++++
.../tajo-core-backend/benchmark/tpch/q11.tql | 27 --------------
.../tajo-core-backend/benchmark/tpch/q12.sql | 24 ++++++++++++
.../tajo-core-backend/benchmark/tpch/q12.tql | 24 ------------
.../tajo-core-backend/benchmark/tpch/q13.sql | 18 +++++++++
.../tajo-core-backend/benchmark/tpch/q13.tql | 18 ---------
.../tajo-core-backend/benchmark/tpch/q14.sql | 13 +++++++
.../tajo-core-backend/benchmark/tpch/q14.tql | 13 -------
.../tajo-core-backend/benchmark/tpch/q15.sql | 32 ++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q15.tql | 32 ----------------
.../tajo-core-backend/benchmark/tpch/q16.sql | 30 +++++++++++++++
.../tajo-core-backend/benchmark/tpch/q16.tql | 30 ---------------
.../tajo-core-backend/benchmark/tpch/q17.sql | 17 +++++++++
.../tajo-core-backend/benchmark/tpch/q17.tql | 17 ---------
.../tajo-core-backend/benchmark/tpch/q18.sql | 33 +++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q18.tql | 33 -----------------
.../tajo-core-backend/benchmark/tpch/q19.sql | 35 ++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q19.tql | 35 ------------------
.../tajo-core-backend/benchmark/tpch/q2.sql | 38 +++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q2.tql | 38 -------------------
.../tajo-core-backend/benchmark/tpch/q20.sql | 36 ++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q20.tql | 36 ------------------
.../tajo-core-backend/benchmark/tpch/q21.sql | 39 ++++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q21.tql | 39 --------------------
.../tajo-core-backend/benchmark/tpch/q22.sql | 36 ++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q22.tql | 36 ------------------
.../tajo-core-backend/benchmark/tpch/q3.sql | 22 +++++++++++
.../tajo-core-backend/benchmark/tpch/q3.tql | 22 -----------
.../tajo-core-backend/benchmark/tpch/q4.sql | 21 +++++++++++
.../tajo-core-backend/benchmark/tpch/q4.tql | 21 -----------
.../tajo-core-backend/benchmark/tpch/q5.sql | 24 ++++++++++++
.../tajo-core-backend/benchmark/tpch/q5.tql | 24 ------------
.../tajo-core-backend/benchmark/tpch/q6.sql | 10 +++++
.../tajo-core-backend/benchmark/tpch/q6.tql | 10 -----
.../tajo-core-backend/benchmark/tpch/q7.sql | 38 +++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q7.tql | 38 -------------------
.../tajo-core-backend/benchmark/tpch/q8.sql | 37 +++++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q8.tql | 37 -------------------
.../tajo-core-backend/benchmark/tpch/q9.sql | 31 ++++++++++++++++
.../tajo-core-backend/benchmark/tpch/q9.tql | 31 ----------------
.../org/apache/tajo/benchmark/BenchmarkSet.java | 4 +-
.../java/org/apache/tajo/client/TajoClient.java | 8 ++--
.../org/apache/tajo/client/TestTajoClient.java | 16 ++++----
.../tajo/engine/planner/TestLogicalPlanner.java | 2 +-
.../apache/tajo/engine/query/TestJoinQuery.java | 2 +-
.../apache/tajo/master/TestGlobalPlanner.java | 4 +-
.../src/test/queries/tpch_q2_simplified.sql | 20 ++++++++++
.../src/test/queries/tpch_q2_simplified.tql | 20 ----------
64 files changed, 682 insertions(+), 681 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ea6938d..5374c05 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -197,6 +197,8 @@ Release 0.2.0 - unreleased
BUG FIXES
+ TAJO-251: Rename the legacy name *.tql to *.sql. (hyunsik)
+
TAJO-169: the default TAJO_WORKER_STANDBY_MODE in tajo-env.sh is wrong.
(hyunsik)
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fa247b8..6a41822 100644
--- a/pom.xml
+++ b/pom.xml
@@ -306,7 +306,6 @@
<excludes>
<exclude>CHANGES.txt</exclude>
<exclude>**/workers</exclude>
- <exclude>**/*.tql</exclude>
<exclude>**/*.sql</exclude>
<exclude>**/*.hiveql</exclude>
<exclude>**/*.schema</exclude>
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/groupby1.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/groupby1.sql b/tajo-core/tajo-core-backend/benchmark/simple/groupby1.sql
new file mode 100644
index 0000000..cb6ff09
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/simple/groupby1.sql
@@ -0,0 +1,6 @@
+select
+ l_orderkey, sum(l_quantity) as sum_qty, max(l_quantity) as max_qty, min(l_quantity) as min_qty
+from
+ lineitem
+group by
+ l_orderkey
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/groupby1.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/groupby1.tql b/tajo-core/tajo-core-backend/benchmark/simple/groupby1.tql
deleted file mode 100644
index cb6ff09..0000000
--- a/tajo-core/tajo-core-backend/benchmark/simple/groupby1.tql
+++ /dev/null
@@ -1,6 +0,0 @@
-select
- l_orderkey, sum(l_quantity) as sum_qty, max(l_quantity) as max_qty, min(l_quantity) as min_qty
-from
- lineitem
-group by
- l_orderkey
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/groupby2.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/groupby2.sql b/tajo-core/tajo-core-backend/benchmark/simple/groupby2.sql
new file mode 100644
index 0000000..7178e20
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/simple/groupby2.sql
@@ -0,0 +1,6 @@
+select
+ l_orderkey, l_linenumber, sum(l_quantity) as sum_qty, max(l_quantity) as max_qty, min(l_quantity) as min_qty
+from
+ lineitem
+group by
+ l_orderkey, l_linenumber
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/groupby2.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/groupby2.tql b/tajo-core/tajo-core-backend/benchmark/simple/groupby2.tql
deleted file mode 100644
index 7178e20..0000000
--- a/tajo-core/tajo-core-backend/benchmark/simple/groupby2.tql
+++ /dev/null
@@ -1,6 +0,0 @@
-select
- l_orderkey, l_linenumber, sum(l_quantity) as sum_qty, max(l_quantity) as max_qty, min(l_quantity) as min_qty
-from
- lineitem
-group by
- l_orderkey, l_linenumber
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/selection1.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/selection1.sql b/tajo-core/tajo-core-backend/benchmark/simple/selection1.sql
new file mode 100644
index 0000000..e5fd404
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/simple/selection1.sql
@@ -0,0 +1,5 @@
+select
+ *
+from
+ lineitem
+
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/selection1.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/selection1.tql b/tajo-core/tajo-core-backend/benchmark/simple/selection1.tql
deleted file mode 100644
index e5fd404..0000000
--- a/tajo-core/tajo-core-backend/benchmark/simple/selection1.tql
+++ /dev/null
@@ -1,5 +0,0 @@
-select
- *
-from
- lineitem
-
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/selection2.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/selection2.sql b/tajo-core/tajo-core-backend/benchmark/simple/selection2.sql
new file mode 100644
index 0000000..0c120d8
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/simple/selection2.sql
@@ -0,0 +1,5 @@
+select
+ l_orderkey, l_linenumber
+from
+ lineitem
+
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/selection2.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/selection2.tql b/tajo-core/tajo-core-backend/benchmark/simple/selection2.tql
deleted file mode 100644
index 0c120d8..0000000
--- a/tajo-core/tajo-core-backend/benchmark/simple/selection2.tql
+++ /dev/null
@@ -1,5 +0,0 @@
-select
- l_orderkey, l_linenumber
-from
- lineitem
-
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/selection3.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/selection3.sql b/tajo-core/tajo-core-backend/benchmark/simple/selection3.sql
new file mode 100644
index 0000000..f415c4e
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/simple/selection3.sql
@@ -0,0 +1,7 @@
+select
+ l_orderkey, l_linenumber
+from
+ lineitem
+where
+ l_shipdate <= '1998-12-01'
+
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/simple/selection3.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/simple/selection3.tql b/tajo-core/tajo-core-backend/benchmark/simple/selection3.tql
deleted file mode 100644
index f415c4e..0000000
--- a/tajo-core/tajo-core-backend/benchmark/simple/selection3.tql
+++ /dev/null
@@ -1,7 +0,0 @@
-select
- l_orderkey, l_linenumber
-from
- lineitem
-where
- l_shipdate <= '1998-12-01'
-
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q1.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q1.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q1.sql
new file mode 100644
index 0000000..3c1f6bb
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q1.sql
@@ -0,0 +1,21 @@
+select
+ l_returnflag,
+ l_linestatus,
+ sum(l_quantity) as sum_qty,
+ sum(l_extendedprice) as sum_base_price,
+ sum(l_extendedprice*(1-l_discount)) as sum_disc_price,
+ sum(l_extendedprice*(1-l_discount)*(1+l_tax)) as sum_charge,
+ avg(l_quantity) as avg_qty,
+ avg(l_extendedprice) as avg_price,
+ avg(l_discount) as avg_disc,
+ count(*) as count_order
+from
+ lineitem
+where
+ l_shipdate <= '1998-09-01'
+group by
+ l_returnflag,
+ l_linestatus
+order by
+ l_returnflag,
+ l_linestatus
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q1.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q1.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q1.tql
deleted file mode 100644
index 3c1f6bb..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q1.tql
+++ /dev/null
@@ -1,21 +0,0 @@
-select
- l_returnflag,
- l_linestatus,
- sum(l_quantity) as sum_qty,
- sum(l_extendedprice) as sum_base_price,
- sum(l_extendedprice*(1-l_discount)) as sum_disc_price,
- sum(l_extendedprice*(1-l_discount)*(1+l_tax)) as sum_charge,
- avg(l_quantity) as avg_qty,
- avg(l_extendedprice) as avg_price,
- avg(l_discount) as avg_disc,
- count(*) as count_order
-from
- lineitem
-where
- l_shipdate <= '1998-09-01'
-group by
- l_returnflag,
- l_linestatus
-order by
- l_returnflag,
- l_linestatus
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q10.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q10.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q10.sql
new file mode 100644
index 0000000..73111c3
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q10.sql
@@ -0,0 +1,31 @@
+select
+ c_custkey,
+ c_name,
+ sum(l_extendedprice * (1 - l_discount)) as revenue,
+ c_acctbal,
+ n_name,
+ c_address,
+ c_phone,
+ c_comment
+from
+ customer,
+ orders,
+ lineitem,
+ nation
+where
+ c_custkey = o_custkey and
+ l_orderkey = o_orderkey and
+ o_orderdate >= '1993-10-01' and
+ o_orderdate < '1994-01-01' and
+ l_returnflag = 'R' and
+ c_nationkey = n_nationkey
+group by
+ c_custkey,
+ c_name,
+ c_acctbal,
+ c_phone,
+ n_name,
+ c_address,
+ c_comment
+order by
+ revenue desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q10.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q10.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q10.tql
deleted file mode 100644
index 73111c3..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q10.tql
+++ /dev/null
@@ -1,31 +0,0 @@
-select
- c_custkey,
- c_name,
- sum(l_extendedprice * (1 - l_discount)) as revenue,
- c_acctbal,
- n_name,
- c_address,
- c_phone,
- c_comment
-from
- customer,
- orders,
- lineitem,
- nation
-where
- c_custkey = o_custkey and
- l_orderkey = o_orderkey and
- o_orderdate >= '1993-10-01' and
- o_orderdate < '1994-01-01' and
- l_returnflag = 'R' and
- c_nationkey = n_nationkey
-group by
- c_custkey,
- c_name,
- c_acctbal,
- c_phone,
- n_name,
- c_address,
- c_comment
-order by
- revenue desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q11.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q11.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q11.sql
new file mode 100644
index 0000000..a36cb66
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q11.sql
@@ -0,0 +1,27 @@
+select
+ ps_partkey,
+ sum(ps_supplycost * ps_availqty) as value
+from
+ partsupp,
+ supplier,
+ nation
+where
+ ps_suppkey = s_suppkey
+ and s_nationkey = n_nationkey
+ and n_name = 'GERMANY'
+group by
+ ps_partkey having
+ sum(ps_supplycost * ps_availqty) > (
+ select
+ sum(ps_supplycost * ps_availqty) * 0.0001
+ from
+ partsupp,
+ supplier,
+ nation
+ where
+ ps_suppkey = s_suppkey
+ and s_nationkey = n_nationkey
+ and n_name = '[NATION]'
+ )
+order by
+ value desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q11.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q11.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q11.tql
deleted file mode 100644
index a36cb66..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q11.tql
+++ /dev/null
@@ -1,27 +0,0 @@
-select
- ps_partkey,
- sum(ps_supplycost * ps_availqty) as value
-from
- partsupp,
- supplier,
- nation
-where
- ps_suppkey = s_suppkey
- and s_nationkey = n_nationkey
- and n_name = 'GERMANY'
-group by
- ps_partkey having
- sum(ps_supplycost * ps_availqty) > (
- select
- sum(ps_supplycost * ps_availqty) * 0.0001
- from
- partsupp,
- supplier,
- nation
- where
- ps_suppkey = s_suppkey
- and s_nationkey = n_nationkey
- and n_name = '[NATION]'
- )
-order by
- value desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q12.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q12.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q12.sql
new file mode 100644
index 0000000..2f26ee9
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q12.sql
@@ -0,0 +1,24 @@
+select
+ l_shipmode,
+ sum(case when o_orderpriority ='1-URGENT' or o_orderpriority ='2-HIGH'
+ then 1
+ else 0
+ end) as high_line_count,
+ sum(case when o_orderpriority != '1-URGENT' and o_orderpriority != '2-HIGH'
+ then 1
+ else 0
+ end) as low_line_count
+from
+ orders,
+ lineitem
+where
+ o_orderkey = l_orderkey and
+ (l_shipmode = 'MAIL' or l_shipmode = 'SHIP') and
+ l_commitdate < l_receiptdate and
+ l_shipdate < l_commitdate and
+ l_receiptdate >= '1994-01-01' and
+ l_receiptdate < '1995-01-01'
+group by
+ l_shipmode
+order by
+ l_shipmode
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q12.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q12.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q12.tql
deleted file mode 100644
index 2f26ee9..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q12.tql
+++ /dev/null
@@ -1,24 +0,0 @@
-select
- l_shipmode,
- sum(case when o_orderpriority ='1-URGENT' or o_orderpriority ='2-HIGH'
- then 1
- else 0
- end) as high_line_count,
- sum(case when o_orderpriority != '1-URGENT' and o_orderpriority != '2-HIGH'
- then 1
- else 0
- end) as low_line_count
-from
- orders,
- lineitem
-where
- o_orderkey = l_orderkey and
- (l_shipmode = 'MAIL' or l_shipmode = 'SHIP') and
- l_commitdate < l_receiptdate and
- l_shipdate < l_commitdate and
- l_receiptdate >= '1994-01-01' and
- l_receiptdate < '1995-01-01'
-group by
- l_shipmode
-order by
- l_shipmode
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q13.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q13.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q13.sql
new file mode 100644
index 0000000..2ee0102
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q13.sql
@@ -0,0 +1,18 @@
+select
+ c_count, count(*) as custdist
+from (
+ select
+ c_custkey,
+ count(o_orderkey)
+ from
+ customer left outer join orders on
+ c_custkey = o_custkey
+ and o_comment not like '%special%requests%'
+ group by
+ c_custkey
+ ) as c_orders (c_custkey, c_count)
+group by
+ c_count
+order by
+ custdist desc,
+ c_count desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q13.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q13.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q13.tql
deleted file mode 100644
index 2ee0102..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q13.tql
+++ /dev/null
@@ -1,18 +0,0 @@
-select
- c_count, count(*) as custdist
-from (
- select
- c_custkey,
- count(o_orderkey)
- from
- customer left outer join orders on
- c_custkey = o_custkey
- and o_comment not like '%special%requests%'
- group by
- c_custkey
- ) as c_orders (c_custkey, c_count)
-group by
- c_count
-order by
- custdist desc,
- c_count desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q14.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q14.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q14.sql
new file mode 100644
index 0000000..f00e469
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q14.sql
@@ -0,0 +1,13 @@
+select
+ 100.00 * sum(case
+ when p_type like 'PROMO%'
+ then l_extendedprice*(1-l_discount)
+ else 0
+ end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
+from
+ lineitem,
+ part
+where
+ l_partkey = p_partkey and
+ l_shipdate >= '1995-09-01' and
+ l_shipdate < '1995-10-01';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q14.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q14.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q14.tql
deleted file mode 100644
index f00e469..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q14.tql
+++ /dev/null
@@ -1,13 +0,0 @@
-select
- 100.00 * sum(case
- when p_type like 'PROMO%'
- then l_extendedprice*(1-l_discount)
- else 0
- end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
-from
- lineitem,
- part
-where
- l_partkey = p_partkey and
- l_shipdate >= '1995-09-01' and
- l_shipdate < '1995-10-01';
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q15.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q15.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q15.sql
new file mode 100644
index 0000000..fc95929
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q15.sql
@@ -0,0 +1,32 @@
+create view revenue[STREAM_ID] (supplier_no, total_revenue) as
+ select
+ l_suppkey,
+ sum(l_extendedprice * (1 - l_discount))
+ from
+ lineitem
+ where
+ l_shipdate >= date '1996-01-01'
+ and l_shipdate < date '1996-01-01' + interval '3' month
+ group by
+ l_suppkey;
+
+select
+ s_suppkey,
+ s_name,
+ s_address,
+ s_phone,
+ total_revenue
+from
+ supplier,
+ revenue[STREAM_ID]
+where
+ s_suppkey = supplier_no
+ and total_revenue = (
+ select
+ max(total_revenue)
+ from
+ revenue[STREAM_ID]
+ )
+order by
+ s_suppkey;
+ drop view revenue[STREAM_ID];
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q15.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q15.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q15.tql
deleted file mode 100644
index fc95929..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q15.tql
+++ /dev/null
@@ -1,32 +0,0 @@
-create view revenue[STREAM_ID] (supplier_no, total_revenue) as
- select
- l_suppkey,
- sum(l_extendedprice * (1 - l_discount))
- from
- lineitem
- where
- l_shipdate >= date '1996-01-01'
- and l_shipdate < date '1996-01-01' + interval '3' month
- group by
- l_suppkey;
-
-select
- s_suppkey,
- s_name,
- s_address,
- s_phone,
- total_revenue
-from
- supplier,
- revenue[STREAM_ID]
-where
- s_suppkey = supplier_no
- and total_revenue = (
- select
- max(total_revenue)
- from
- revenue[STREAM_ID]
- )
-order by
- s_suppkey;
- drop view revenue[STREAM_ID];
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q16.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q16.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q16.sql
new file mode 100644
index 0000000..18713e4
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q16.sql
@@ -0,0 +1,30 @@
+select
+ p_brand,
+ p_type,
+ p_size,
+ count(distinct ps_suppkey) as supplier_cnt
+from
+ partsupp,
+ part
+where
+ p_partkey = ps_partkey
+ and p_brand <> 'Brand#45'
+ and p_type not like 'MEDIUM POLISHED%'
+ and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
+ and ps_suppkey not in (
+ select
+ s_suppkey
+ from
+ supplier
+ where
+ s_comment like '%Customer%Complaints%'
+ )
+group by
+ p_brand,
+ p_type,
+ p_size
+order by
+ supplier_cnt desc,
+ p_brand,
+ p_type,
+ p_size;
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q16.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q16.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q16.tql
deleted file mode 100644
index 18713e4..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q16.tql
+++ /dev/null
@@ -1,30 +0,0 @@
-select
- p_brand,
- p_type,
- p_size,
- count(distinct ps_suppkey) as supplier_cnt
-from
- partsupp,
- part
-where
- p_partkey = ps_partkey
- and p_brand <> 'Brand#45'
- and p_type not like 'MEDIUM POLISHED%'
- and p_size in (49, 14, 23, 45, 19, 3, 36, 9)
- and ps_suppkey not in (
- select
- s_suppkey
- from
- supplier
- where
- s_comment like '%Customer%Complaints%'
- )
-group by
- p_brand,
- p_type,
- p_size
-order by
- supplier_cnt desc,
- p_brand,
- p_type,
- p_size;
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q17.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q17.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q17.sql
new file mode 100644
index 0000000..d67a399
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q17.sql
@@ -0,0 +1,17 @@
+select
+ sum(l_extendedprice) / 7.0 as avg_yearly
+from
+ lineitem,
+ part
+where
+ p_partkey = l_partkey
+ and p_brand = 'Brand#23'
+ and p_container = 'MED BOX'
+ and l_quantity < (
+ select
+ 0.2 * avg(l_quantity)
+ from
+ lineitem
+ where
+ l_partkey = p_partkey
+ )
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q17.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q17.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q17.tql
deleted file mode 100644
index d67a399..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q17.tql
+++ /dev/null
@@ -1,17 +0,0 @@
-select
- sum(l_extendedprice) / 7.0 as avg_yearly
-from
- lineitem,
- part
-where
- p_partkey = l_partkey
- and p_brand = 'Brand#23'
- and p_container = 'MED BOX'
- and l_quantity < (
- select
- 0.2 * avg(l_quantity)
- from
- lineitem
- where
- l_partkey = p_partkey
- )
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q18.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q18.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q18.sql
new file mode 100644
index 0000000..43b2787
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q18.sql
@@ -0,0 +1,33 @@
+select
+ c_name,
+ c_custkey,
+ o_orderkey,
+ o_orderdate,
+ o_totalprice,
+ sum(l_quantity)
+from
+ customer,
+ orders,
+ lineitem
+where
+ o_orderkey in (
+ select
+ l_orderkey
+ from
+ lineitem
+ group by
+ l_orderkey
+ having
+ sum(l_quantity) > [QUANTITY]
+ )
+ and c_custkey = o_custkey
+ and o_orderkey = l_orderkey
+group by
+ c_name,
+ c_custkey,
+ o_orderkey,
+ o_orderdate,
+ o_totalprice
+order by
+ o_totalprice desc,
+ o_orderdate
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q18.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q18.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q18.tql
deleted file mode 100644
index 43b2787..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q18.tql
+++ /dev/null
@@ -1,33 +0,0 @@
-select
- c_name,
- c_custkey,
- o_orderkey,
- o_orderdate,
- o_totalprice,
- sum(l_quantity)
-from
- customer,
- orders,
- lineitem
-where
- o_orderkey in (
- select
- l_orderkey
- from
- lineitem
- group by
- l_orderkey
- having
- sum(l_quantity) > [QUANTITY]
- )
- and c_custkey = o_custkey
- and o_orderkey = l_orderkey
-group by
- c_name,
- c_custkey,
- o_orderkey,
- o_orderdate,
- o_totalprice
-order by
- o_totalprice desc,
- o_orderdate
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q19.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q19.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q19.sql
new file mode 100644
index 0000000..7760e46
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q19.sql
@@ -0,0 +1,35 @@
+select
+ sum(l_extendedprice * (1 - l_discount) ) as revenue
+from
+ lineitem,
+ part
+where
+ (
+ p_partkey = l_partkey
+ and p_brand = 'Brand#12'
+ and p_container in ( 'SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
+ and l_quantity >= 1 and l_quantity <= 1 + 10
+ and p_size between 1 and 5
+ and l_shipmode in ('AIR', 'AIR REG')
+ and l_shipinstruct = 'DELIVER IN PERSON'
+ )
+or
+ (
+ p_partkey = l_partkey
+ and p_brand = 'Brand#23'
+ and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
+ and l_quantity >= 10 and l_quantity <= 10 + 10
+ and p_size between 1 and 10
+ and l_shipmode in ('AIR', 'AIR REG')
+ and l_shipinstruct = 'DELIVER IN PERSON'
+ )
+or
+ (
+ p_partkey = l_partkey
+ and p_brand = 'Brand#34'
+ and p_container in ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
+ and l_quantity >= 20 and l_quantity <= 20 + 10
+ and p_size between 1 and 15
+ and l_shipmode in ('AIR', 'AIR REG')
+ and l_shipinstruct = 'DELIVER IN PERSON'
+ )
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q19.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q19.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q19.tql
deleted file mode 100644
index 7760e46..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q19.tql
+++ /dev/null
@@ -1,35 +0,0 @@
-select
- sum(l_extendedprice * (1 - l_discount) ) as revenue
-from
- lineitem,
- part
-where
- (
- p_partkey = l_partkey
- and p_brand = 'Brand#12'
- and p_container in ( 'SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
- and l_quantity >= 1 and l_quantity <= 1 + 10
- and p_size between 1 and 5
- and l_shipmode in ('AIR', 'AIR REG')
- and l_shipinstruct = 'DELIVER IN PERSON'
- )
-or
- (
- p_partkey = l_partkey
- and p_brand = 'Brand#23'
- and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
- and l_quantity >= 10 and l_quantity <= 10 + 10
- and p_size between 1 and 10
- and l_shipmode in ('AIR', 'AIR REG')
- and l_shipinstruct = 'DELIVER IN PERSON'
- )
-or
- (
- p_partkey = l_partkey
- and p_brand = 'Brand#34'
- and p_container in ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
- and l_quantity >= 20 and l_quantity <= 20 + 10
- and p_size between 1 and 15
- and l_shipmode in ('AIR', 'AIR REG')
- and l_shipinstruct = 'DELIVER IN PERSON'
- )
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q2.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q2.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q2.sql
new file mode 100644
index 0000000..b7a7cd8
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q2.sql
@@ -0,0 +1,38 @@
+select
+ s_acctbal,
+ s_name,
+ n_name,
+ p_partkey,
+ p_mfgr,
+ s_address,
+ s_phone,
+ s_comment
+from
+ part,
+ supplier,
+ partsupp,
+ nation,
+ region
+where
+ p_partkey = ps_partkey
+ and s_suppkey = ps_suppkey
+ and p_size = 15
+ and p_type like '%BRASS'
+ and s_nationkey = n_nationkey
+ and n_regionkey = r_regionkey
+ and r_name = 'c'
+ and ps_supplycost =
+ (
+ select min(ps_supplycost) from partsupp, supplier, nation, region
+ where
+ p_partkey = ps_partkey
+ and s_suppkey = ps_suppkey
+ and s_nationkey = n_nationkey
+ and n_regionkey = r_regionkey
+ and r_name = 'EUROPE'
+ )
+order by
+ s_acctbal desc,
+ n_name,
+ s_name,
+ p_partkey
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q2.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q2.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q2.tql
deleted file mode 100644
index b7a7cd8..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q2.tql
+++ /dev/null
@@ -1,38 +0,0 @@
-select
- s_acctbal,
- s_name,
- n_name,
- p_partkey,
- p_mfgr,
- s_address,
- s_phone,
- s_comment
-from
- part,
- supplier,
- partsupp,
- nation,
- region
-where
- p_partkey = ps_partkey
- and s_suppkey = ps_suppkey
- and p_size = 15
- and p_type like '%BRASS'
- and s_nationkey = n_nationkey
- and n_regionkey = r_regionkey
- and r_name = 'c'
- and ps_supplycost =
- (
- select min(ps_supplycost) from partsupp, supplier, nation, region
- where
- p_partkey = ps_partkey
- and s_suppkey = ps_suppkey
- and s_nationkey = n_nationkey
- and n_regionkey = r_regionkey
- and r_name = 'EUROPE'
- )
-order by
- s_acctbal desc,
- n_name,
- s_name,
- p_partkey
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q20.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q20.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q20.sql
new file mode 100644
index 0000000..11f9919
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q20.sql
@@ -0,0 +1,36 @@
+select
+ s_name,
+ s_address
+from
+ supplier, nation
+ where
+ s_suppkey in (
+ select
+ ps_suppkey
+ from
+ partsupp
+ where
+ ps_partkey in (
+ select
+ p_partkey
+ from
+ part
+ where
+ p_name like 'forest%'
+ )
+ and ps_availqty > (
+ select
+ 0.5 * sum(l_quantity)
+ from
+ lineitem
+ where
+ l_partkey = ps_partkey
+ and l_suppkey = ps_suppkey
+ and l_shipdate >= date('1994-01-01')
+ and l_shipdate < date('1994-01-01') + interval '1' year
+ )
+ )
+ and s_nationkey = n_nationkey
+ and n_name = 'CANADA'
+order by
+ s_name
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q20.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q20.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q20.tql
deleted file mode 100644
index 11f9919..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q20.tql
+++ /dev/null
@@ -1,36 +0,0 @@
-select
- s_name,
- s_address
-from
- supplier, nation
- where
- s_suppkey in (
- select
- ps_suppkey
- from
- partsupp
- where
- ps_partkey in (
- select
- p_partkey
- from
- part
- where
- p_name like 'forest%'
- )
- and ps_availqty > (
- select
- 0.5 * sum(l_quantity)
- from
- lineitem
- where
- l_partkey = ps_partkey
- and l_suppkey = ps_suppkey
- and l_shipdate >= date('1994-01-01')
- and l_shipdate < date('1994-01-01') + interval '1' year
- )
- )
- and s_nationkey = n_nationkey
- and n_name = 'CANADA'
-order by
- s_name
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q21.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q21.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q21.sql
new file mode 100644
index 0000000..66cb0d4
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q21.sql
@@ -0,0 +1,39 @@
+select
+ s_name,
+ count(*) as numwait
+from
+ supplier,
+ lineitem l1,
+ orders,
+ nation
+where
+ s_suppkey = l1.l_suppkey
+ and o_orderkey = l1.l_orderkey
+ and o_orderstatus = 'F'
+ and l1.l_receiptdate > l1.l_commitdate
+ and exists (
+ select
+ *
+ from
+ lineitem l2
+ where
+ l2.l_orderkey = l1.l_orderkey
+ and l2.l_suppkey <> l1.l_suppkey
+ )
+ and not exists (
+ select
+ *
+ from
+ lineitem l3
+ where
+ l3.l_orderkey = l1.l_orderkey
+ and l3.l_suppkey <> l1.l_suppkey
+ and l3.l_receiptdate > l3.l_commitdate
+ )
+ and s_nationkey = n_nationkey
+ and n_name = 'SAUDI ARABIA'
+group by
+ s_name
+order by
+ numwait desc,
+ s_name
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q21.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q21.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q21.tql
deleted file mode 100644
index 66cb0d4..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q21.tql
+++ /dev/null
@@ -1,39 +0,0 @@
-select
- s_name,
- count(*) as numwait
-from
- supplier,
- lineitem l1,
- orders,
- nation
-where
- s_suppkey = l1.l_suppkey
- and o_orderkey = l1.l_orderkey
- and o_orderstatus = 'F'
- and l1.l_receiptdate > l1.l_commitdate
- and exists (
- select
- *
- from
- lineitem l2
- where
- l2.l_orderkey = l1.l_orderkey
- and l2.l_suppkey <> l1.l_suppkey
- )
- and not exists (
- select
- *
- from
- lineitem l3
- where
- l3.l_orderkey = l1.l_orderkey
- and l3.l_suppkey <> l1.l_suppkey
- and l3.l_receiptdate > l3.l_commitdate
- )
- and s_nationkey = n_nationkey
- and n_name = 'SAUDI ARABIA'
-group by
- s_name
-order by
- numwait desc,
- s_name
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q22.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q22.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q22.sql
new file mode 100644
index 0000000..d315e48
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q22.sql
@@ -0,0 +1,36 @@
+select
+ cntrycode,
+ count(*) as numcust,
+ sum(c_acctbal) as totacctbal
+from (
+ select
+ substring(c_phone from 1 for 2) as cntrycode,
+ c_acctbal
+ from
+ customer
+ where
+ substring(c_phone from 1 for 2) in
+ ('13','31','23','29','30','18','17')
+ and c_acctbal > (
+ select
+ avg(c_acctbal)
+ from
+ customer
+ where
+ c_acctbal > 0.00
+ and substring (c_phone from 1 for 2) in
+ ('13','31','23','29','30','18','17')
+ )
+ and not exists (
+ select
+ *
+ from
+ orders
+ where
+ o_custkey = c_custkey
+ )
+ ) as custsale
+group by
+ cntrycode
+order by
+ cntrycode
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q22.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q22.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q22.tql
deleted file mode 100644
index d315e48..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q22.tql
+++ /dev/null
@@ -1,36 +0,0 @@
-select
- cntrycode,
- count(*) as numcust,
- sum(c_acctbal) as totacctbal
-from (
- select
- substring(c_phone from 1 for 2) as cntrycode,
- c_acctbal
- from
- customer
- where
- substring(c_phone from 1 for 2) in
- ('13','31','23','29','30','18','17')
- and c_acctbal > (
- select
- avg(c_acctbal)
- from
- customer
- where
- c_acctbal > 0.00
- and substring (c_phone from 1 for 2) in
- ('13','31','23','29','30','18','17')
- )
- and not exists (
- select
- *
- from
- orders
- where
- o_custkey = c_custkey
- )
- ) as custsale
-group by
- cntrycode
-order by
- cntrycode
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q3.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q3.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q3.sql
new file mode 100644
index 0000000..60c8fdb
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q3.sql
@@ -0,0 +1,22 @@
+select
+ l_orderkey,
+ sum(l_extendedprice*(1-l_discount)) as revenue,
+ o_orderdate,
+ o_shippriority
+from
+ customer,
+ orders,
+ lineitem
+where
+ c_mktsegment = 'BUILDING' and
+ c_custkey = o_custkey and
+ l_orderkey = o_orderkey and
+ o_orderdate < '1995-03-15' and
+ l_shipdate > '1995-03-15'
+group by
+ l_orderkey,
+ o_orderdate,
+ o_shippriority
+order by
+ revenue desc,
+ o_orderdate
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q3.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q3.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q3.tql
deleted file mode 100644
index 60c8fdb..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q3.tql
+++ /dev/null
@@ -1,22 +0,0 @@
-select
- l_orderkey,
- sum(l_extendedprice*(1-l_discount)) as revenue,
- o_orderdate,
- o_shippriority
-from
- customer,
- orders,
- lineitem
-where
- c_mktsegment = 'BUILDING' and
- c_custkey = o_custkey and
- l_orderkey = o_orderkey and
- o_orderdate < '1995-03-15' and
- l_shipdate > '1995-03-15'
-group by
- l_orderkey,
- o_orderdate,
- o_shippriority
-order by
- revenue desc,
- o_orderdate
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q4.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q4.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q4.sql
new file mode 100644
index 0000000..2ab4598
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q4.sql
@@ -0,0 +1,21 @@
+select
+ o_orderpriority,
+ count(*) as order_count
+from
+ orders
+where
+ o_orderdate >= '1993-07-01'
+ and o_orderdate < '1993-10-01'
+ and exists (
+ select
+ *
+ from
+ lineitem
+ where
+ l_orderkey = o_orderkey
+ and l_commitdate < l_receiptdate
+ )
+group by
+ o_orderpriority
+order by
+ o_orderpriority;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q4.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q4.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q4.tql
deleted file mode 100644
index 2ab4598..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q4.tql
+++ /dev/null
@@ -1,21 +0,0 @@
-select
- o_orderpriority,
- count(*) as order_count
-from
- orders
-where
- o_orderdate >= '1993-07-01'
- and o_orderdate < '1993-10-01'
- and exists (
- select
- *
- from
- lineitem
- where
- l_orderkey = o_orderkey
- and l_commitdate < l_receiptdate
- )
-group by
- o_orderpriority
-order by
- o_orderpriority;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q5.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q5.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q5.sql
new file mode 100644
index 0000000..e7d3d56
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q5.sql
@@ -0,0 +1,24 @@
+select
+ n_name,
+ sum(l_extendedprice * (1 - l_discount)) as revenue
+from
+ customer,
+ orders,
+ lineitem,
+ supplier,
+ nation,
+ region
+where
+ c_custkey = o_custkey and
+ l_orderkey = o_orderkey and
+ l_suppkey = s_suppkey and
+ c_nationkey = s_nationkey and
+ s_nationkey = n_nationkey and
+ n_regionkey = r_regionkey and
+ r_name = 'ASIA' and
+ o_orderdate >= '1994-01-01' and
+ o_orderdate < '1995-01-01'
+group by
+ n_name
+order by
+ revenue desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q5.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q5.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q5.tql
deleted file mode 100644
index e7d3d56..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q5.tql
+++ /dev/null
@@ -1,24 +0,0 @@
-select
- n_name,
- sum(l_extendedprice * (1 - l_discount)) as revenue
-from
- customer,
- orders,
- lineitem,
- supplier,
- nation,
- region
-where
- c_custkey = o_custkey and
- l_orderkey = o_orderkey and
- l_suppkey = s_suppkey and
- c_nationkey = s_nationkey and
- s_nationkey = n_nationkey and
- n_regionkey = r_regionkey and
- r_name = 'ASIA' and
- o_orderdate >= '1994-01-01' and
- o_orderdate < '1995-01-01'
-group by
- n_name
-order by
- revenue desc
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q6.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q6.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q6.sql
new file mode 100644
index 0000000..6427ca7
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q6.sql
@@ -0,0 +1,10 @@
+select
+ sum(l_extendedprice*l_discount) as revenue
+from
+ lineitem
+where
+ l_shipdate >= '1994-01-01' and
+ l_shipdate < '1995-01-01' and
+ l_discount >= 0.05 and
+ l_discount <= 0.07 and
+ l_quantity < 24
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q6.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q6.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q6.tql
deleted file mode 100644
index 6427ca7..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q6.tql
+++ /dev/null
@@ -1,10 +0,0 @@
-select
- sum(l_extendedprice*l_discount) as revenue
-from
- lineitem
-where
- l_shipdate >= '1994-01-01' and
- l_shipdate < '1995-01-01' and
- l_discount >= 0.05 and
- l_discount <= 0.07 and
- l_quantity < 24
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q7.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q7.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q7.sql
new file mode 100644
index 0000000..a7d0f79
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q7.sql
@@ -0,0 +1,38 @@
+select
+ supp_nation,
+ cust_nation,
+ l_year,
+ sum(volume) as revenue
+from (
+ select
+ n1.n_name as supp_nation,
+ n2.n_name as cust_nation,
+ l_shipdate as l_year,
+ l_extendedprice * (1 - l_discount) as volume
+ from
+ supplier,
+ lineitem,
+ orders,
+ customer,
+ nation n1,
+ nation n2
+ where
+ s_suppkey = l_suppkey
+ and o_orderkey = l_orderkey
+ and c_custkey = o_custkey
+ and s_nationkey = n1.n_nationkey
+ and c_nationkey = n2.n_nationkey
+ and (
+ (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
+ or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
+ )
+ and '1995-01-01' < l_shipdate and l_shipdate < '1996-12-31'
+ ) as shipping
+group by
+ supp_nation,
+ cust_nation,
+ l_year
+order by
+ supp_nation,
+ cust_nation,
+ l_year;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q7.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q7.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q7.tql
deleted file mode 100644
index a7d0f79..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q7.tql
+++ /dev/null
@@ -1,38 +0,0 @@
-select
- supp_nation,
- cust_nation,
- l_year,
- sum(volume) as revenue
-from (
- select
- n1.n_name as supp_nation,
- n2.n_name as cust_nation,
- l_shipdate as l_year,
- l_extendedprice * (1 - l_discount) as volume
- from
- supplier,
- lineitem,
- orders,
- customer,
- nation n1,
- nation n2
- where
- s_suppkey = l_suppkey
- and o_orderkey = l_orderkey
- and c_custkey = o_custkey
- and s_nationkey = n1.n_nationkey
- and c_nationkey = n2.n_nationkey
- and (
- (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY')
- or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE')
- )
- and '1995-01-01' < l_shipdate and l_shipdate < '1996-12-31'
- ) as shipping
-group by
- supp_nation,
- cust_nation,
- l_year
-order by
- supp_nation,
- cust_nation,
- l_year;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q8.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q8.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q8.sql
new file mode 100644
index 0000000..9e96d4d
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q8.sql
@@ -0,0 +1,37 @@
+select
+ o_year,
+ sum(case
+ when nation = 'BRAZIL'
+ then volume
+ else 0
+ end) / sum(volume) as mkt_share
+from (
+ select
+ o_orderdate as o_year,
+ l_extendedprice * (1-l_discount) as volume,
+ n2.n_name as nation
+ from
+ part,
+ supplier,
+ lineitem,
+ orders,
+ customer,
+ nation n1,
+ nation n2,
+ region
+ where
+ p_partkey = l_partkey
+ and s_suppkey = l_suppkey
+ and l_orderkey = o_orderkey
+ and o_custkey = c_custkey
+ and c_nationkey = n1.n_nationkey
+ and n1.n_regionkey = r_regionkey
+ and r_name = 'AMERICA'
+ and s_nationkey = n2.n_nationkey
+ and '1995-01-01' < o_orderdate and o_orderdate <'1996-12-31'
+ and p_type = 'ECONOMY ANODIZED STEEL'
+ ) as all_nations
+group by
+ o_year
+order by
+ o_year;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q8.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q8.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q8.tql
deleted file mode 100644
index 9e96d4d..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q8.tql
+++ /dev/null
@@ -1,37 +0,0 @@
-select
- o_year,
- sum(case
- when nation = 'BRAZIL'
- then volume
- else 0
- end) / sum(volume) as mkt_share
-from (
- select
- o_orderdate as o_year,
- l_extendedprice * (1-l_discount) as volume,
- n2.n_name as nation
- from
- part,
- supplier,
- lineitem,
- orders,
- customer,
- nation n1,
- nation n2,
- region
- where
- p_partkey = l_partkey
- and s_suppkey = l_suppkey
- and l_orderkey = o_orderkey
- and o_custkey = c_custkey
- and c_nationkey = n1.n_nationkey
- and n1.n_regionkey = r_regionkey
- and r_name = 'AMERICA'
- and s_nationkey = n2.n_nationkey
- and '1995-01-01' < o_orderdate and o_orderdate <'1996-12-31'
- and p_type = 'ECONOMY ANODIZED STEEL'
- ) as all_nations
-group by
- o_year
-order by
- o_year;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q9.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q9.sql b/tajo-core/tajo-core-backend/benchmark/tpch/q9.sql
new file mode 100644
index 0000000..06c69ed
--- /dev/null
+++ b/tajo-core/tajo-core-backend/benchmark/tpch/q9.sql
@@ -0,0 +1,31 @@
+select
+ nation,
+ o_year,
+ sum(amount) as sum_profit
+ from (
+ select
+ n_name as nation,
+ o_orderdate as o_year,
+ l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
+ from
+ part,
+ supplier,
+ lineitem,
+ partsupp,
+ orders,
+ nation
+ where
+ s_suppkey = l_suppkey
+ and ps_suppkey = l_suppkey
+ and ps_partkey = l_partkey
+ and p_partkey = l_partkey
+ and o_orderkey = l_orderkey
+ and s_nationkey = n_nationkey
+ and p_name like 'green'
+ ) as profit
+group by
+ nation,
+ o_year
+order by
+ nation,
+ o_year desc;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/benchmark/tpch/q9.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/benchmark/tpch/q9.tql b/tajo-core/tajo-core-backend/benchmark/tpch/q9.tql
deleted file mode 100644
index 06c69ed..0000000
--- a/tajo-core/tajo-core-backend/benchmark/tpch/q9.tql
+++ /dev/null
@@ -1,31 +0,0 @@
-select
- nation,
- o_year,
- sum(amount) as sum_profit
- from (
- select
- n_name as nation,
- o_orderdate as o_year,
- l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
- from
- part,
- supplier,
- lineitem,
- partsupp,
- orders,
- nation
- where
- s_suppkey = l_suppkey
- and ps_suppkey = l_suppkey
- and ps_partkey = l_partkey
- and p_partkey = l_partkey
- and o_orderkey = l_orderkey
- and s_nationkey = n_nationkey
- and p_name like 'green'
- ) as profit
-group by
- nation,
- o_year
-order by
- nation,
- o_year desc;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/BenchmarkSet.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/BenchmarkSet.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/BenchmarkSet.java
index 1664b1c..af3d002 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/BenchmarkSet.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/benchmark/BenchmarkSet.java
@@ -66,8 +66,8 @@ public abstract class BenchmarkSet {
int last;
String name, query;
for (String file : queryDir.list()) {
- if (file.endsWith(".tql")) {
- last = file.indexOf(".tql");
+ if (file.endsWith(".sql")) {
+ last = file.indexOf(".sql");
name = file.substring(0, last);
query = FileUtil.readTextFile(new File(queryDir + "/" + file));
}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
index 5e75403..a819f7a 100644
--- a/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
+++ b/tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/client/TajoClient.java
@@ -124,9 +124,9 @@ public class TajoClient {
* In order to get the result, you should use {@link #getQueryResult(org.apache.tajo.QueryId)}
* or {@link #getQueryResultAndWait(org.apache.tajo.QueryId)}.
*/
- public GetQueryStatusResponse executeQuery(String tql) throws ServiceException {
+ public GetQueryStatusResponse executeQuery(String sql) throws ServiceException {
QueryRequest.Builder builder = QueryRequest.newBuilder();
- builder.setQuery(tql);
+ builder.setQuery(sql);
return tajoMasterService.submitQuery(null, builder.build());
}
@@ -265,9 +265,9 @@ public class TajoClient {
return CatalogUtil.newTableDesc(response.getTableDesc());
}
- public boolean updateQuery(String tql) throws ServiceException {
+ public boolean updateQuery(String sql) throws ServiceException {
QueryRequest.Builder builder = QueryRequest.newBuilder();
- builder.setQuery(tql);
+ builder.setQuery(sql);
ResultCode resultCode =
tajoMasterService.updateQuery(null, builder.build()).getResultCode();
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/client/TestTajoClient.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/client/TestTajoClient.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/client/TestTajoClient.java
index 84a5c50..61518e0 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/client/TestTajoClient.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/client/TestTajoClient.java
@@ -90,10 +90,10 @@ public class TestTajoClient {
Path tablePath = writeTmpTable(tableName);
assertFalse(tajo.existTable(tableName));
- String tql =
+ String sql =
"create external table " + tableName + " (deptname text, score integer) "
+ "using csv location '" + tablePath + "'";
- tajo.updateQuery(tql);
+ tajo.updateQuery(sql);
assertTrue(tajo.existTable(tableName));
}
@@ -121,10 +121,10 @@ public class TestTajoClient {
Path tablePath = writeTmpTable(tableName);
assertFalse(tajo.existTable(tableName));
- String tql = "create external table " + tableName + " (deptname text, score int4) " + "using csv location '"
+ String sql = "create external table " + tableName + " (deptname text, score int4) " + "using csv location '"
+ tablePath + "'";
- tajo.executeQueryAndGetResult(tql);
+ tajo.executeQueryAndGetResult(sql);
assertTrue(tajo.existTable(tableName));
tajo.updateQuery("drop table " + tableName);
@@ -140,9 +140,9 @@ public class TestTajoClient {
assertFalse(tajo.existTable(tableName));
- String tql = "create table " + tableName + " (deptname text, score int4)";
+ String sql = "create table " + tableName + " (deptname text, score int4)";
- tajo.updateQuery(tql);
+ tajo.updateQuery(sql);
assertTrue(tajo.existTable(tableName));
Path tablePath = tajo.getTableDesc(tableName).getPath();
@@ -161,10 +161,10 @@ public class TestTajoClient {
BackendTestingUtil.writeTmpTable(conf, "file:///tmp", tableName, false);
assertFalse(tajo.existTable(tableName));
- String tql =
+ String sql =
"create external table " + tableName + " (deptname text, score int4) "
+ "using csv location 'file:///tmp/" + tableName + "'";
- tajo.executeQueryAndGetResult(tql);
+ tajo.executeQueryAndGetResult(sql);
assertTrue(tajo.existTable(tableName));
}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
index 7adf8d2..989e3ce 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
@@ -391,7 +391,7 @@ public class TestLogicalPlanner {
@Test
public final void testMultipleJoin() throws IOException, PlanningException {
Expr expr = sqlAnalyzer.parse(
- FileUtil.readTextFile(new File("src/test/queries/tpch_q2_simplified.tql")));
+ FileUtil.readTextFile(new File("src/test/queries/tpch_q2_simplified.sql")));
LogicalNode plan = planner.createPlan(expr).getRootBlock().getRoot();
testJsonSerDerObject(plan);
Schema expected = tpch.getOutSchema("q2");
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
index 233e9ee..bf069ec 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
@@ -87,7 +87,7 @@ public class TestJoinQuery {
@Test
public final void testTPCHQ2Join() throws Exception {
ResultSet res = tpch.execute(FileUtil
- .readTextFile(new File("src/test/queries/tpch_q2_simplified.tql")));
+ .readTextFile(new File("src/test/queries/tpch_q2_simplified.sql")));
try {
Object [][] result = new Object[3][3];
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestGlobalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestGlobalPlanner.java b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestGlobalPlanner.java
index 5441e2f..bc616c6 100644
--- a/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestGlobalPlanner.java
+++ b/tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/master/TestGlobalPlanner.java
@@ -118,7 +118,7 @@ public class TestGlobalPlanner {
@Test
public void testMultipleJoin() throws Exception {
- buildPlan(FileUtil.readTextFile(new File("src/test/queries/tpch_q2_simplified.tql")));
+ buildPlan(FileUtil.readTextFile(new File("src/test/queries/tpch_q2_simplified.sql")));
}
@Test
@@ -193,6 +193,6 @@ public class TestGlobalPlanner {
@Test
public void testTPCH_Q5() throws Exception {
- buildPlan(FileUtil.readTextFile(new File("benchmark/tpch/q5.tql")));
+ buildPlan(FileUtil.readTextFile(new File("benchmark/tpch/q5.sql")));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.sql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.sql b/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.sql
new file mode 100644
index 0000000..80999d5
--- /dev/null
+++ b/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.sql
@@ -0,0 +1,20 @@
+select
+ s_acctbal,
+ s_name,
+ n_name,
+ p_partkey,
+ p_mfgr,
+ s_address,
+ s_phone,
+ s_comment
+from
+ part,
+ supplier,
+ partsupp,
+ nation,
+ region
+where
+ p_partkey = ps_partkey
+ and s_suppkey = ps_suppkey
+ and s_nationkey = n_nationkey
+ and n_regionkey = r_regionkey
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/0bea1fdd/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.tql
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.tql b/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.tql
deleted file mode 100644
index 80999d5..0000000
--- a/tajo-core/tajo-core-backend/src/test/queries/tpch_q2_simplified.tql
+++ /dev/null
@@ -1,20 +0,0 @@
-select
- s_acctbal,
- s_name,
- n_name,
- p_partkey,
- p_mfgr,
- s_address,
- s_phone,
- s_comment
-from
- part,
- supplier,
- partsupp,
- nation,
- region
-where
- p_partkey = ps_partkey
- and s_suppkey = ps_suppkey
- and s_nationkey = n_nationkey
- and n_regionkey = r_regionkey