From 3e4d4650601d3a8b8eb1ca5f6b06852e4b007848 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 5 Jul 2022 11:41:12 -0400 Subject: [PATCH 1/4] Fix 'Brand#MN' being supplied as 'BRAND#MN' in TPCH Q16, Q17, Q19 to match the specification --- .../oltpbenchmark/benchmarks/tpch/TPCHUtil.java | 15 +++++++++++++++ .../benchmarks/tpch/procedures/Q16.java | 8 ++------ .../benchmarks/tpch/procedures/Q17.java | 8 ++------ .../benchmarks/tpch/procedures/Q19.java | 15 ++++----------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHUtil.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHUtil.java index 93f0a141b..cd6cbb73c 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHUtil.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHUtil.java @@ -99,4 +99,19 @@ public static String getRegionFromRegionKey(int regionKey) { } } + /** + * Generates a random brand string of the form 'Brand#MN' where M and N are + * two single character strings representing two numbers randomly and + * independently selected within [1 .. 5] + * + * @param rand Random generator to use + * @return A random brand conforming to the TPCH specification + */ + public static String randomBrand(RandomGenerator rand) { + int M = rand.number(1, 5); + int N = rand.number(1, 5); + + return String.format("Brand#%d%d", M, N); + } + } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java index f77f33893..f0869b171 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java @@ -30,7 +30,7 @@ public class Q16 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT p_brand, p_type, @@ -67,11 +67,7 @@ AND p_size IN (?, ?, ?, ?, ?, ?, ?, ?) @Override protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { - // BRAND = Brand#MN where M and N are two single character strings representing two numbers randomly and - // independently selected within [1 .. 5]; - int M = rand.number(1, 5); - int N = rand.number(1, 5); - String brand = String.format("BRAND#%d%d", M, N); + String brand = TPCHUtil.randomBrand(rand); // TYPE is made of the first 2 syllables of a string randomly selected within the // list of 3-syllable strings defined for Types in Clause 4.2.2.13 diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java index c1a602e83..3afda69bc 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java @@ -28,7 +28,7 @@ public class Q17 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT SUM(l_extendedprice) / 7.0 AS avg_yearly FROM @@ -50,11 +50,7 @@ public class Q17 extends GenericQuery { @Override protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { - // BRAND = 'Brand#MN' where MN is a two character string representing two numbers randomly and independently - // selected within [1 .. 5] - int M = rand.number(1, 5); - int N = rand.number(1, 5); - String brand = String.format("BRAND#%d%d", M, N); + String brand = TPCHUtil.randomBrand(rand); // CONTAINER is randomly selected within the list of 2-syllable strings defined for Containers in Clause // 4.2.2.13 diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java index 73829ad9b..65bf8f476 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java @@ -18,6 +18,7 @@ package com.oltpbenchmark.benchmarks.tpch.procedures; import com.oltpbenchmark.api.SQLStmt; +import com.oltpbenchmark.benchmarks.tpch.TPCHUtil; import com.oltpbenchmark.util.RandomGenerator; import java.sql.Connection; @@ -81,17 +82,9 @@ protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) // BRAND1, BRAND2, BRAND3 = 'Brand#MN' where each MN is a two character string representing two numbers // randomly and independently selected within [1 .. 5] - int M; - int N; - M = rand.number(1, 5); - N = rand.number(1, 5); - String brand1 = String.format("BRAND#%d%d", M, N); - M = rand.number(1, 5); - N = rand.number(1, 5); - String brand2 = String.format("BRAND#%d%d", M, N); - M = rand.number(1, 5); - N = rand.number(1, 5); - String brand3 = String.format("BRAND#%d%d", M, N); + String brand1 = TPCHUtil.randomBrand(rand); + String brand2 = TPCHUtil.randomBrand(rand); + String brand3 = TPCHUtil.randomBrand(rand); PreparedStatement stmt = this.getPreparedStatement(conn, query_stmt); stmt.setString(1, brand1); From 02ba5a09713c0a2e57dcce84354ce128af08e86a Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 6 Jul 2022 09:29:29 -0400 Subject: [PATCH 2/4] Fix wrong query text for TPCH Q12. Note that the dialect configuration meant that for at least some databases the correct query text is used anyways, which is why there were not errors from mismatching # and type of query parameters. --- .../benchmarks/tpch/procedures/Q12.java | 55 +++++++++++-------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java index 8c7755982..945451e60 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java @@ -29,32 +29,43 @@ public class Q12 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT - ps_partkey, - SUM(ps_supplycost * ps_availqty) AS VALUE + 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 - partsupp, - supplier, - nation + orders, + lineitem WHERE - ps_suppkey = s_suppkey - AND s_nationkey = n_nationkey - AND n_name = 'ETHIOPIA' + o_orderkey = l_orderkey + AND l_shipmode IN (?, ?) + AND l_commitdate < l_receiptdate + AND l_shipdate < l_commitdate + AND l_receiptdate >= DATE ? + AND l_receiptdate < DATE ? + INTERVAL '1' YEAR GROUP BY - ps_partkey - HAVING - SUM(ps_supplycost * ps_availqty) > ( - SELECT - SUM(ps_supplycost * ps_availqty) * ? - FROM - partsupp, supplier, nation - WHERE - ps_suppkey = s_suppkey - AND s_nationkey = n_nationkey - AND n_name = ? ) - ORDER BY - VALUE DESC + l_shipmode + ORDER BY + l_shipmode """ ); From d324a1ff3c06f8706882ac001363cb1a00b0a92d Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 6 Jul 2022 10:03:12 -0400 Subject: [PATCH 3/4] Fix TPCH Q11: was not using the workload scale factor and incorrectly had 'ETHIOPIA' hardcoded for one of the nation keys. --- .../java/com/oltpbenchmark/api/BenchmarkModule.java | 2 +- src/main/java/com/oltpbenchmark/api/Procedure.java | 13 ++++++++----- .../benchmarks/tpch/procedures/Q11.java | 12 ++++++------ .../benchmarks/tpch/dialect-cockroachdb.xml | 2 +- .../api/AbstractTestBenchmarkModule.java | 2 +- .../java/com/oltpbenchmark/api/TestProcedure.java | 5 ++++- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java index ddd0a6cc0..d7ea5134c 100644 --- a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java +++ b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java @@ -360,7 +360,7 @@ public Map getProcedures() { for (TransactionType txn : txns) { Procedure proc = ClassUtil.newInstance(txn.getProcedureClass(), new Object[0], new Class[0]); - proc.initialize(this.workConf.getDatabaseType()); + proc.initialize(this.workConf); proc_xref.put(txn, proc); proc.loadSQLDialect(this.dialects); } diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index b40f11233..833c29080 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -17,6 +17,7 @@ package com.oltpbenchmark.api; +import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.jdbc.AutoIncrementPreparedStatement; import com.oltpbenchmark.types.DatabaseType; import org.slf4j.Logger; @@ -36,7 +37,7 @@ public abstract class Procedure { private static final Logger LOG = LoggerFactory.getLogger(Procedure.class); private final String procName; - private DatabaseType dbType; + protected WorkloadConfiguration workConf; private Map name_stmt_xref; /** @@ -51,11 +52,12 @@ protected Procedure() { * the constructor, otherwise we can't get access to all of our SQLStmts. * * @param + * @param workConf Workload configuration * @return */ @SuppressWarnings("unchecked") - protected final T initialize(DatabaseType dbType) { - this.dbType = dbType; + protected final T initialize(WorkloadConfiguration workConf) { + this.workConf = workConf; this.name_stmt_xref = Procedure.getStatements(this); if (LOG.isDebugEnabled()) { @@ -109,8 +111,9 @@ public final PreparedStatement getPreparedStatementReturnKeys(Connection conn, S // HACK: If the target system is Postgres, wrap the PreparedStatement in a special // one that fakes the getGeneratedKeys(). - if (is != null && (this.dbType == DatabaseType.POSTGRES || this.dbType == DatabaseType.COCKROACHDB)) { - pStmt = new AutoIncrementPreparedStatement(this.dbType, conn.prepareStatement(stmt.getSQL())); + DatabaseType dbType = this.workConf.getDatabaseType(); + if (is != null && (dbType == DatabaseType.POSTGRES || dbType == DatabaseType.COCKROACHDB)) { + pStmt = new AutoIncrementPreparedStatement(dbType, conn.prepareStatement(stmt.getSQL())); } // Everyone else can use the regular getGeneratedKeys() method else if (is != null) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java index 1e75c0088..846974bf8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java @@ -28,7 +28,7 @@ public class Q11 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT ps_partkey, SUM(ps_supplycost * ps_availqty) AS VALUE @@ -39,7 +39,7 @@ public class Q11 extends GenericQuery { WHERE ps_suppkey = s_suppkey AND s_nationkey = n_nationkey - AND n_name = 'ETHIOPIA' + AND n_name = ? GROUP BY ps_partkey HAVING @@ -63,12 +63,12 @@ protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) String nation = TPCHUtil.choice(TPCHConstants.N_NAME, rand); // FRACTION is chosen as 0.0001 / SF - // TODO: we should technically pass dbgen's SF down here somehow - double fraction = 0.0001; + double fraction = 0.0001 / this.workConf.getScaleFactor(); PreparedStatement stmt = this.getPreparedStatement(conn, query_stmt); - stmt.setDouble(1, fraction); - stmt.setString(2, nation); + stmt.setString(1, nation); + stmt.setDouble(2, fraction); + stmt.setString(3, nation); return stmt; } } diff --git a/src/main/resources/benchmarks/tpch/dialect-cockroachdb.xml b/src/main/resources/benchmarks/tpch/dialect-cockroachdb.xml index ca931486f..e3ae38032 100644 --- a/src/main/resources/benchmarks/tpch/dialect-cockroachdb.xml +++ b/src/main/resources/benchmarks/tpch/dialect-cockroachdb.xml @@ -45,7 +45,7 @@ - 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 = 'ETHIOPIA' group by ps_partkey having sum(ps_supplycost * ps_availqty) > ( select sum(ps_supplycost * ps_availqty) * CAST(? AS DECIMAL) from partsupp, supplier, nation where ps_suppkey = s_suppkey and s_nationkey = n_nationkey and n_name = ? ) order by value desc + 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 = ? group by ps_partkey having sum(ps_supplycost * ps_availqty) > ( select sum(ps_supplycost * ps_availqty) * CAST(? AS DECIMAL) from partsupp, supplier, nation where ps_suppkey = s_suppkey and s_nationkey = n_nationkey and n_name = ? ) order by value desc diff --git a/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java b/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java index 247157ec0..18abe0a76 100644 --- a/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java +++ b/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java @@ -170,7 +170,7 @@ public void testSetSQLDialect() throws Exception { Procedure testProc = ClassUtil.newInstance(proc.getClass().getName(), new Object[0], new Class[0]); assertNotNull(testProc); - testProc.initialize(dbType); + testProc.initialize(this.workConf); testProc.loadSQLDialect(dialects); Collection dialectStatementNames = dialects.getStatementNames( diff --git a/src/test/java/com/oltpbenchmark/api/TestProcedure.java b/src/test/java/com/oltpbenchmark/api/TestProcedure.java index 1966f37ee..a461a1c7b 100644 --- a/src/test/java/com/oltpbenchmark/api/TestProcedure.java +++ b/src/test/java/com/oltpbenchmark/api/TestProcedure.java @@ -16,6 +16,7 @@ package com.oltpbenchmark.api; +import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.benchmarks.tatp.procedures.DeleteCallForwarding; import com.oltpbenchmark.types.DatabaseType; import junit.framework.TestCase; @@ -52,7 +53,9 @@ public void testGetStatements() throws Exception { */ public void testGetStatementsConstructor() throws Exception { Procedure proc = new DeleteCallForwarding(); - proc.initialize(DatabaseType.POSTGRES); + WorkloadConfiguration workConf = new WorkloadConfiguration(); + workConf.setDatabaseType(DatabaseType.POSTGRES); + proc.initialize(workConf); // Make sure that procedure handle has the same // SQLStmts as what we get back from the static method From 48841892d90277dee43f0ee42e5cb0ffc7be1257 Mon Sep 17 00:00:00 2001 From: Theo Date: Thu, 7 Jul 2022 08:51:01 -0400 Subject: [PATCH 4/4] Modify TPCH Q11 fix to pass scale factor as a parameter instead of making the whole configuration available. --- .../java/com/oltpbenchmark/api/BenchmarkModule.java | 2 +- src/main/java/com/oltpbenchmark/api/Procedure.java | 13 +++++-------- .../oltpbenchmark/benchmarks/tpch/TPCHWorker.java | 2 +- .../benchmarks/tpch/procedures/GenericQuery.java | 6 +++--- .../benchmarks/tpch/procedures/Q1.java | 2 +- .../benchmarks/tpch/procedures/Q10.java | 4 ++-- .../benchmarks/tpch/procedures/Q11.java | 4 ++-- .../benchmarks/tpch/procedures/Q12.java | 2 +- .../benchmarks/tpch/procedures/Q13.java | 4 ++-- .../benchmarks/tpch/procedures/Q14.java | 4 ++-- .../benchmarks/tpch/procedures/Q15.java | 8 ++++---- .../benchmarks/tpch/procedures/Q16.java | 2 +- .../benchmarks/tpch/procedures/Q17.java | 2 +- .../benchmarks/tpch/procedures/Q18.java | 2 +- .../benchmarks/tpch/procedures/Q19.java | 2 +- .../benchmarks/tpch/procedures/Q2.java | 2 +- .../benchmarks/tpch/procedures/Q20.java | 4 ++-- .../benchmarks/tpch/procedures/Q21.java | 4 ++-- .../benchmarks/tpch/procedures/Q22.java | 6 +++--- .../benchmarks/tpch/procedures/Q3.java | 4 ++-- .../benchmarks/tpch/procedures/Q4.java | 4 ++-- .../benchmarks/tpch/procedures/Q5.java | 2 +- .../benchmarks/tpch/procedures/Q6.java | 4 ++-- .../benchmarks/tpch/procedures/Q7.java | 2 +- .../benchmarks/tpch/procedures/Q8.java | 2 +- .../benchmarks/tpch/procedures/Q9.java | 4 ++-- .../api/AbstractTestBenchmarkModule.java | 2 +- .../java/com/oltpbenchmark/api/TestProcedure.java | 5 +---- 28 files changed, 49 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java index d7ea5134c..ddd0a6cc0 100644 --- a/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java +++ b/src/main/java/com/oltpbenchmark/api/BenchmarkModule.java @@ -360,7 +360,7 @@ public Map getProcedures() { for (TransactionType txn : txns) { Procedure proc = ClassUtil.newInstance(txn.getProcedureClass(), new Object[0], new Class[0]); - proc.initialize(this.workConf); + proc.initialize(this.workConf.getDatabaseType()); proc_xref.put(txn, proc); proc.loadSQLDialect(this.dialects); } diff --git a/src/main/java/com/oltpbenchmark/api/Procedure.java b/src/main/java/com/oltpbenchmark/api/Procedure.java index 833c29080..b40f11233 100644 --- a/src/main/java/com/oltpbenchmark/api/Procedure.java +++ b/src/main/java/com/oltpbenchmark/api/Procedure.java @@ -17,7 +17,6 @@ package com.oltpbenchmark.api; -import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.jdbc.AutoIncrementPreparedStatement; import com.oltpbenchmark.types.DatabaseType; import org.slf4j.Logger; @@ -37,7 +36,7 @@ public abstract class Procedure { private static final Logger LOG = LoggerFactory.getLogger(Procedure.class); private final String procName; - protected WorkloadConfiguration workConf; + private DatabaseType dbType; private Map name_stmt_xref; /** @@ -52,12 +51,11 @@ protected Procedure() { * the constructor, otherwise we can't get access to all of our SQLStmts. * * @param - * @param workConf Workload configuration * @return */ @SuppressWarnings("unchecked") - protected final T initialize(WorkloadConfiguration workConf) { - this.workConf = workConf; + protected final T initialize(DatabaseType dbType) { + this.dbType = dbType; this.name_stmt_xref = Procedure.getStatements(this); if (LOG.isDebugEnabled()) { @@ -111,9 +109,8 @@ public final PreparedStatement getPreparedStatementReturnKeys(Connection conn, S // HACK: If the target system is Postgres, wrap the PreparedStatement in a special // one that fakes the getGeneratedKeys(). - DatabaseType dbType = this.workConf.getDatabaseType(); - if (is != null && (dbType == DatabaseType.POSTGRES || dbType == DatabaseType.COCKROACHDB)) { - pStmt = new AutoIncrementPreparedStatement(dbType, conn.prepareStatement(stmt.getSQL())); + if (is != null && (this.dbType == DatabaseType.POSTGRES || this.dbType == DatabaseType.COCKROACHDB)) { + pStmt = new AutoIncrementPreparedStatement(this.dbType, conn.prepareStatement(stmt.getSQL())); } // Everyone else can use the regular getGeneratedKeys() method else if (is != null) { diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java index 387eab712..fa26f8e32 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/TPCHWorker.java @@ -41,7 +41,7 @@ public TPCHWorker(TPCHBenchmark benchmarkModule, int id) { protected TransactionStatus executeWork(Connection conn, TransactionType nextTransaction) throws UserAbortException, SQLException { try { GenericQuery proc = (GenericQuery) this.getProcedure(nextTransaction.getProcedureClass()); - proc.run(conn, rand); + proc.run(conn, rand, this.configuration.getScaleFactor()); } catch (ClassCastException e) { throw new RuntimeException(e); } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/GenericQuery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/GenericQuery.java index 466066721..4b5f8bacd 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/GenericQuery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/GenericQuery.java @@ -31,11 +31,11 @@ public abstract class GenericQuery extends Procedure { protected static final Logger LOG = LoggerFactory.getLogger(GenericQuery.class); - protected abstract PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException; + protected abstract PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException; - public void run(Connection conn, RandomGenerator rand) throws SQLException { + public void run(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { - try (PreparedStatement stmt = getStatement(conn, rand); ResultSet rs = stmt.executeQuery()) { + try (PreparedStatement stmt = getStatement(conn, rand, scaleFactor); ResultSet rs = stmt.executeQuery()) { while (rs.next()) { //do nothing } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java index 0a1d0bdcc..d6d901576 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q1.java @@ -52,7 +52,7 @@ public class Q1 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { String delta = String.valueOf(rand.number(60, 120)); PreparedStatement stmt = this.getPreparedStatement(conn, query_stmt); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java index 111fa41a5..4ecac97d8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q10.java @@ -27,7 +27,7 @@ public class Q10 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT c_custkey, c_name, @@ -63,7 +63,7 @@ public class Q10 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // DATE is the first day of a randomly selected month from the second month of 1993 to the first month of 1995 int year = rand.number(1993, 1995); int month = rand.number(year == 1993 ? 2 : 1, year == 1995 ? 1 : 12); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java index 846974bf8..131c151f7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q11.java @@ -58,12 +58,12 @@ public class Q11 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // NATION is randomly selected within the list of values defined for N_NAME in Clause 4.2.3 String nation = TPCHUtil.choice(TPCHConstants.N_NAME, rand); // FRACTION is chosen as 0.0001 / SF - double fraction = 0.0001 / this.workConf.getScaleFactor(); + double fraction = 0.0001 / scaleFactor; PreparedStatement stmt = this.getPreparedStatement(conn, query_stmt); stmt.setString(1, nation); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java index 945451e60..b394cd2b7 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q12.java @@ -70,7 +70,7 @@ AND l_shipmode IN (?, ?) ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // SHIPMODE1 is randomly selected within the list of values defined for Modes in Clause 4.2.2.13 String shipMode1 = TPCHUtil.choice(TPCHConstants.MODES, rand); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java index 9017bead4..21e228cfd 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q13.java @@ -27,7 +27,7 @@ public class Q13 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT c_count, COUNT(*) AS custdist @@ -55,7 +55,7 @@ public class Q13 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // WORD1 is randomly selected from 4 possible values: special, pending, unusual, express String word1 = TPCHUtil.choice(new String[]{"special", "pending", "unusual", "express"}, rand); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java index 16aab6233..9f32516ff 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q14.java @@ -27,7 +27,7 @@ public class Q14 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT 100.00 * SUM( CASE @@ -49,7 +49,7 @@ public class Q14 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // DATE is the first day of a month randomly selected from a random year within [1993 .. 1997] int year = rand.number(1993, 1997); int month = rand.number(1, 12); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java index db802862d..5aca587c1 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q15.java @@ -42,7 +42,7 @@ CREATE view revenue0 (supplier_no, total_revenue) AS """ ); - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT s_suppkey, s_name, @@ -71,7 +71,7 @@ CREATE view revenue0 (supplier_no, total_revenue) AS ); @Override - public void run(Connection conn, RandomGenerator rand) throws SQLException { + public void run(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // With this query, we have to set up a view before we execute the // query, then drop it once we're done. try (Statement stmt = conn.createStatement()) { @@ -85,7 +85,7 @@ public void run(Connection conn, RandomGenerator rand) throws SQLException { String sql = createview_stmt.getSQL(); sql = sql.replace("?", String.format("'%s'", date)); stmt.execute(sql); - super.run(conn, rand); + super.run(conn, rand, scaleFactor); } finally { String sql = dropview_stmt.getSQL(); stmt.execute(sql); @@ -95,7 +95,7 @@ public void run(Connection conn, RandomGenerator rand) throws SQLException { } @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { return this.getPreparedStatement(conn, query_stmt); } } diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java index f0869b171..70487115f 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q16.java @@ -66,7 +66,7 @@ AND p_size IN (?, ?, ?, ?, ?, ?, ?, ?) ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { String brand = TPCHUtil.randomBrand(rand); // TYPE is made of the first 2 syllables of a string randomly selected within the diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java index 3afda69bc..c72fcb4ab 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q17.java @@ -49,7 +49,7 @@ public class Q17 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { String brand = TPCHUtil.randomBrand(rand); // CONTAINER is randomly selected within the list of 2-syllable strings defined for Containers in Clause diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java index 195977642..5ae8bc433 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q18.java @@ -65,7 +65,7 @@ public class Q18 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // QUANTITY is randomly selected within [312..315] int quantity = rand.number(312, 315); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java index 65bf8f476..fbb93e04d 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q19.java @@ -70,7 +70,7 @@ AND l_shipmode IN ('AIR', 'AIR REG') ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // QUANTITY1 is randomly selected within [1..10] int quantity1 = rand.number(1, 10); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java index 6981b2aac..ff3b55bda 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q2.java @@ -77,7 +77,7 @@ public class Q2 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { int size = rand.number(1, 50); String type = TPCHUtil.choice(TPCHConstants.TYPE_S3, rand); String region = TPCHUtil.choice(TPCHConstants.R_NAME, rand); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java index 362077f14..5cb274589 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q20.java @@ -29,7 +29,7 @@ public class Q20 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT s_name, s_address @@ -72,7 +72,7 @@ public class Q20 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // COLOR is randomly selected within the list of values defined for the generation of P_NAME String color = TPCHUtil.choice(TPCHConstants.P_NAME_GENERATOR, rand) + "%"; diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java index 40a69b615..eeacb04ac 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q21.java @@ -28,7 +28,7 @@ public class Q21 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT s_name, COUNT(*) AS numwait @@ -74,7 +74,7 @@ public class Q21 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // NATION is randomly selected within the list of values defined for N_NAME in Clause 4.2.3 String nation = TPCHUtil.choice(TPCHConstants.N_NAME, rand); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java index e187d5f6c..6b29285df 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q22.java @@ -28,7 +28,7 @@ public class Q22 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT cntrycode, COUNT(*) AS numcust, @@ -42,7 +42,7 @@ public class Q22 extends GenericQuery { customer WHERE SUBSTRING(c_phone FROM 1 FOR 2) IN (?, ?, ?, ?, ?, ?, ?) - AND c_acctbal > + AND c_acctbal > ( SELECT AVG(c_acctbal) @@ -71,7 +71,7 @@ AND SUBSTRING(c_phone FROM 1 FOR 2) IN (?, ?, ?, ?, ?, ?, ?) ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // I1 - I7 are randomly selected without repetition from the possible values diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java index 80a232a91..bc8fc3afc 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q3.java @@ -29,7 +29,7 @@ public class Q3 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT l_orderkey, SUM(l_extendedprice * (1 - l_discount)) AS revenue, @@ -56,7 +56,7 @@ public class Q3 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { String segment = TPCHUtil.choice(TPCHConstants.SEGMENTS, rand); // date must be randomly selected between [1995-03-01, 1995-03-31] diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java index 98dca1261..46081bfb8 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q4.java @@ -27,7 +27,7 @@ public class Q4 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT o_orderpriority, COUNT(*) AS order_count @@ -54,7 +54,7 @@ public class Q4 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { int year = rand.number(1993, 1997); int month = rand.number(1, 10); String date = String.format("%d-%02d-01", year, month); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java index 5ea9d9e0f..1bd7932bf 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q5.java @@ -58,7 +58,7 @@ public class Q5 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { String region = TPCHUtil.choice(TPCHConstants.R_NAME, rand); int year = rand.number(1993, 1997); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java index 8c9e037a6..40e1cd414 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q6.java @@ -27,7 +27,7 @@ public class Q6 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT SUM(l_extendedprice * l_discount) AS revenue FROM @@ -41,7 +41,7 @@ public class Q6 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // DATE is the first of January of a randomly selected year within [1993 .. 1997] int year = rand.number(1993, 1997); String date = String.format("%d-01-01", year); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java index 5eac395ec..c4f09e761 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q7.java @@ -77,7 +77,7 @@ public class Q7 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // NATION1 is randomly selected within the list of values defined for N_NAME in Clause 4.2.3 String nation1 = TPCHUtil.choice(TPCHConstants.N_NAME, rand); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java index 12ad68365..ae2366852 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q8.java @@ -79,7 +79,7 @@ public class Q8 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // NATION is randomly selected within the list of values defined for N_NAME in Clause 4.2.3 String nation = TPCHUtil.choice(TPCHConstants.N_NAME, rand); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java index a6748d01a..7de35a9bf 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpch/procedures/Q9.java @@ -28,7 +28,7 @@ public class Q9 extends GenericQuery { - public final SQLStmt query_stmt = new SQLStmt(""" + public final SQLStmt query_stmt = new SQLStmt(""" SELECT nation, o_year, @@ -68,7 +68,7 @@ public class Q9 extends GenericQuery { ); @Override - protected PreparedStatement getStatement(Connection conn, RandomGenerator rand) throws SQLException { + protected PreparedStatement getStatement(Connection conn, RandomGenerator rand, double scaleFactor) throws SQLException { // COLOR is randomly selected within the list of values defined for the generation of P_NAME in Clause 4.2.3 String color = "%" + TPCHUtil.choice(TPCHConstants.P_NAME_GENERATOR, rand) + "%"; diff --git a/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java b/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java index 18abe0a76..247157ec0 100644 --- a/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java +++ b/src/test/java/com/oltpbenchmark/api/AbstractTestBenchmarkModule.java @@ -170,7 +170,7 @@ public void testSetSQLDialect() throws Exception { Procedure testProc = ClassUtil.newInstance(proc.getClass().getName(), new Object[0], new Class[0]); assertNotNull(testProc); - testProc.initialize(this.workConf); + testProc.initialize(dbType); testProc.loadSQLDialect(dialects); Collection dialectStatementNames = dialects.getStatementNames( diff --git a/src/test/java/com/oltpbenchmark/api/TestProcedure.java b/src/test/java/com/oltpbenchmark/api/TestProcedure.java index a461a1c7b..1966f37ee 100644 --- a/src/test/java/com/oltpbenchmark/api/TestProcedure.java +++ b/src/test/java/com/oltpbenchmark/api/TestProcedure.java @@ -16,7 +16,6 @@ package com.oltpbenchmark.api; -import com.oltpbenchmark.WorkloadConfiguration; import com.oltpbenchmark.benchmarks.tatp.procedures.DeleteCallForwarding; import com.oltpbenchmark.types.DatabaseType; import junit.framework.TestCase; @@ -53,9 +52,7 @@ public void testGetStatements() throws Exception { */ public void testGetStatementsConstructor() throws Exception { Procedure proc = new DeleteCallForwarding(); - WorkloadConfiguration workConf = new WorkloadConfiguration(); - workConf.setDatabaseType(DatabaseType.POSTGRES); - proc.initialize(workConf); + proc.initialize(DatabaseType.POSTGRES); // Make sure that procedure handle has the same // SQLStmts as what we get back from the static method