From 82bc2a28f382f68ecbe8befe70020bf8b562cb70 Mon Sep 17 00:00:00 2001 From: Yuchen Deng Date: Thu, 14 Dec 2017 18:43:25 -0500 Subject: [PATCH] Temporary fix for Cubrid('Interval' syntax) --- src/com/oltpbenchmark/benchmarks/tpch/queries/Q1.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q10.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q12.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q14.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q15.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q20.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q4.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q5.java | 2 +- src/com/oltpbenchmark/benchmarks/tpch/queries/Q6.java | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q1.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q1.java index 27841c192..e4df177a9 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q1.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q1.java @@ -35,7 +35,7 @@ public class Q1 extends GenericQuery { + "from " + "lineitem " + "where " - + "l_shipdate <= date '1998-12-01' - interval '95' day " + + "l_shipdate <= ADDDATE('1998-12-01', interval -'95' day) " + "group by " + "l_returnflag, " + "l_linestatus " diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q10.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q10.java index 9c1bba626..b44a96da0 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q10.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q10.java @@ -39,7 +39,7 @@ public class Q10 extends GenericQuery { + "c_custkey = o_custkey " + "and l_orderkey = o_orderkey " + "and o_orderdate >= date '1994-12-01' " - + "and o_orderdate < date '1994-12-01' + interval '3' month " + + "and o_orderdate < ADDDATE('1994-12-01' , interval '3' month) " + "and l_returnflag = 'R' " + "and c_nationkey = n_nationkey " + "group by " diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q12.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q12.java index 1f86796b7..6b42356bf 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q12.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q12.java @@ -44,7 +44,7 @@ public class Q12 extends GenericQuery { + "and l_commitdate < l_receiptdate " + "and l_shipdate < l_commitdate " + "and l_receiptdate >= date '1997-01-01' " - + "and l_receiptdate < date '1997-01-01' + interval '1' year " + + "and l_receiptdate < ADDDATE( '1997-01-01' , interval '1' year)" + "group by " + "l_shipmode " + "order by " diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q14.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q14.java index b78058e39..f7f129051 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q14.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q14.java @@ -33,7 +33,7 @@ public class Q14 extends GenericQuery { + "where " + "l_partkey = p_partkey " + "and l_shipdate >= date '1997-04-01' " - + "and l_shipdate < date '1997-04-01' + interval '1' month" + + "and l_shipdate < ADDDATE( '1997-04-01' , interval '1' month)" ); protected SQLStmt get_query() { diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q15.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q15.java index 3228aa068..0dcd15b23 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q15.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q15.java @@ -33,7 +33,7 @@ public class Q15 extends GenericQuery { + "lineitem " + "where " + "l_shipdate >= date '1997-03-01' " - + "and l_shipdate < date '1997-03-01' + interval '3' month " + + "and l_shipdate < ADDDATE('1997-03-01' , interval '3' month) " + "group by " + "l_suppkey" ); diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q20.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q20.java index dbb9b18d2..f2d49d889 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q20.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q20.java @@ -51,7 +51,7 @@ public class Q20 extends GenericQuery { + "l_partkey = ps_partkey " + "and l_suppkey = ps_suppkey " + "and l_shipdate >= date '1997-01-01' " - + "and l_shipdate < date '1997-01-01' + interval '1' year " + + "and l_shipdate < ADDDATE( '1997-01-01', interval '1' year) " + ") " + ") " + "and s_nationkey = n_nationkey " diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q4.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q4.java index d23440522..3ea8e97a1 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q4.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q4.java @@ -28,7 +28,7 @@ public class Q4 extends GenericQuery { + "orders " + "where " + "o_orderdate >= date '1994-08-01' " - + "and o_orderdate < date '1994-08-01' + interval '3' month " + + "and o_orderdate < ADDDATE ('1994-08-01', interval '3' month) " + "and exists ( " + "select " + "* " diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q5.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q5.java index 9629699c4..8315f0555 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q5.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q5.java @@ -40,7 +40,7 @@ public class Q5 extends GenericQuery { + "and n_regionkey = r_regionkey " + "and r_name = 'AFRICA' " + "and o_orderdate >= date '1997-01-01' " - + "and o_orderdate < date '1997-01-01' + interval '1' year " + + "and o_orderdate < ADDDATE( '1997-01-01' + interval '1' year) " + "group by " + "n_name " + "order by " diff --git a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q6.java b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q6.java index 308d634ec..692be1292 100644 --- a/src/com/oltpbenchmark/benchmarks/tpch/queries/Q6.java +++ b/src/com/oltpbenchmark/benchmarks/tpch/queries/Q6.java @@ -27,7 +27,7 @@ public class Q6 extends GenericQuery { + "lineitem " + "where " + "l_shipdate >= date '1997-01-01' " - + "and l_shipdate < date '1997-01-01' + interval '1' year " + + "and l_shipdate < ADDDATE('1997-01-01' , interval '1' year)" + "and l_discount between 0.07 - 0.01 and 0.07 + 0.01 " + "and l_quantity < 24" );