You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2016/06/06 22:21:09 UTC

incubator-kudu git commit: Improve tpch usability

Repository: incubator-kudu
Updated Branches:
  refs/heads/master a2e24ba5c -> 4044b94f8


Improve tpch usability

* tpch.sh should use $ROOT to find the CPU scaling script (I had a
  problem with it otherwise)
* tpch1.cc should print the error if the CHECK fails (e.g. cannot create
  the data directory)
* Allow for skipping the line count check (e.g. if we run with SF != 1)
* Allow for passing command-line parameters to tpch1

Change-Id: I604b0f7433781be78d76ca34f3e30e49ddeca6a8
Reviewed-on: http://gerrit.cloudera.org:8080/3279
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: Jean-Daniel Cryans
Tested-by: Mike Percy <mp...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/4044b94f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/4044b94f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/4044b94f

Branch: refs/heads/master
Commit: 4044b94f8eb9481a7e25945d7bb270c40dfc7eaf
Parents: a2e24ba
Author: Mike Percy <mp...@apache.org>
Authored: Wed Jun 1 19:51:52 2016 -0700
Committer: Mike Percy <mp...@apache.org>
Committed: Mon Jun 6 22:03:17 2016 +0000

----------------------------------------------------------------------
 src/kudu/benchmarks/tpch/tpch1.cc |  7 +++++--
 src/kudu/scripts/tpch.sh          | 13 +++++++------
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4044b94f/src/kudu/benchmarks/tpch/tpch1.cc
----------------------------------------------------------------------
diff --git a/src/kudu/benchmarks/tpch/tpch1.cc b/src/kudu/benchmarks/tpch/tpch1.cc
index 73fb295..91d22b3 100644
--- a/src/kudu/benchmarks/tpch/tpch1.cc
+++ b/src/kudu/benchmarks/tpch/tpch1.cc
@@ -81,6 +81,7 @@ DEFINE_string(tpch_path_to_data, "/tmp/lineitem.tbl",
               "The full path to the '|' separated file containing the lineitem table.");
 DEFINE_int32(tpch_num_query_iterations, 1, "Number of times the query will be run.");
 DEFINE_int32(tpch_expected_matching_rows, 5916591, "Number of rows that should match the query.");
+DEFINE_bool(tpch_check_matching_rows, true, "Whether to check the number of matching rows.");
 DEFINE_bool(use_mini_cluster, true,
             "Create a mini cluster for the work to be performed against.");
 DEFINE_string(mini_cluster_base_dir, "/tmp/tpch",
@@ -231,7 +232,9 @@ void Tpch1(RpcLineItemDAO *dao) {
     delete maps;
     delete returnflag.slice.data();
   }
-  CHECK_EQ(matching_rows, FLAGS_tpch_expected_matching_rows) << "Wrong number of rows returned";
+  if (FLAGS_tpch_check_matching_rows) {
+    CHECK_EQ(matching_rows, FLAGS_tpch_expected_matching_rows) << "Wrong number of rows returned";
+  }
 }
 
 } // namespace kudu
@@ -246,7 +249,7 @@ int main(int argc, char **argv) {
   if (FLAGS_use_mini_cluster) {
     env.reset(new kudu::EnvWrapper(kudu::Env::Default()));
     kudu::Status s = env->CreateDir(FLAGS_mini_cluster_base_dir);
-    CHECK(s.IsAlreadyPresent() || s.ok());
+    CHECK(s.IsAlreadyPresent() || s.ok()) << s.ToString();
     kudu::MiniClusterOptions options;
     options.data_root = FLAGS_mini_cluster_base_dir;
     cluster.reset(new kudu::MiniCluster(env.get(), options));

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/4044b94f/src/kudu/scripts/tpch.sh
----------------------------------------------------------------------
diff --git a/src/kudu/scripts/tpch.sh b/src/kudu/scripts/tpch.sh
index db9fb7f..8db8cda 100755
--- a/src/kudu/scripts/tpch.sh
+++ b/src/kudu/scripts/tpch.sh
@@ -67,7 +67,7 @@ record_result() {
 }
 
 ensure_cpu_scaling() {
-  $(dirname $BASH_SOURCE)/ensure_cpu_scaling.sh "$@"
+  $ROOT/src/kudu/scripts/ensure_cpu_scaling.sh "$@"
 }
 
 ##########################################################
@@ -126,11 +126,12 @@ OUTDIR=$ROOT/build/$BUILD_TYPE/tpch
 rm -Rf $KUDU_DATA_DIR   # Clean up data dir.
 mkdir -p $OUTDIR        # Create log file output dir.
 
-./build/$BUILD_TYPE/bin/tpch1 -logtostderr=1 \
-                              -tpch_path_to_data=$LINEITEM_TBL_PATH \
-                              -mini_cluster_base_dir=$KUDU_DATA_DIR \
-                              -tpch_num_query_iterations=$TPCH_NUM_QUERY_ITERS \
-                              >$OUTDIR/benchmark.log 2>&1
+$ROOT/build/$BUILD_TYPE/bin/tpch1 -logtostderr=1 \
+                                  -tpch_path_to_data=$LINEITEM_TBL_PATH \
+                                  -mini_cluster_base_dir=$KUDU_DATA_DIR \
+                                  -tpch_num_query_iterations=$TPCH_NUM_QUERY_ITERS \
+                                  $* \
+                                  >$OUTDIR/benchmark.log 2>&1
 
 cat $OUTDIR/benchmark.log
 INSERT_TIME=$(grep "Time spent loading" $OUTDIR/benchmark.log | \