You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2020/11/10 00:48:03 UTC
[kudu] 01/02: [tool] fix tpch1 overlapped flag table_name
This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 3c6438d94b9d71ad97c15b8b44893631fe4b66a9
Author: ningw <19...@gmail.com>
AuthorDate: Tue Nov 3 17:45:03 2020 +0800
[tool] fix tpch1 overlapped flag table_name
ERROR: flag 'table_name' was defined more than once
(in files '/data/src/kudu/tools/tool_action_common.cc' and '/data/src/kudu/benchmarks/tpch/tpch1.cc').
Change-Id: I7adda247007ba5f3af52aa33603f719b99c0d4b2
Reviewed-on: http://gerrit.cloudera.org:8080/16693
Tested-by: Kudu Jenkins
Reviewed-by: Bankim Bhavsar <ba...@cloudera.com>
---
src/kudu/benchmarks/tpch/tpch1.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/kudu/benchmarks/tpch/tpch1.cc b/src/kudu/benchmarks/tpch/tpch1.cc
index 3471602..34231c7 100644
--- a/src/kudu/benchmarks/tpch/tpch1.cc
+++ b/src/kudu/benchmarks/tpch/tpch1.cc
@@ -104,8 +104,7 @@ DEFINE_int32(tpch_max_batch_size, 1000,
"Maximum number of inserts/updates to batch at once. Set to 0 "
"to delegate the batching control to the logic of the "
"KuduSession running in AUTO_BACKGROUND_MODE flush mode.");
-DEFINE_string(table_name, "lineitem",
- "The table name to write/read");
+DECLARE_string(table_name);
using kudu::client::KuduRowResult;
using std::string;
@@ -132,7 +131,7 @@ struct SliceMapKey {
// This copies the string out of the result buffer
void RelocateSlice() {
- auto buf = new uint8_t[slice.size()];
+ auto* buf = new uint8_t[slice.size()];
slice.relocate(buf);
}
@@ -273,8 +272,10 @@ int main(int argc, char **argv) {
master_address = FLAGS_master_address;
}
+ string tpch_table_name = FLAGS_table_name.empty() ? "lineitem" : FLAGS_table_name;
+
unique_ptr<kudu::RpcLineItemDAO> dao(new kudu::RpcLineItemDAO(
- master_address, FLAGS_table_name, FLAGS_tpch_max_batch_size,
+ master_address, std::move(tpch_table_name), FLAGS_tpch_max_batch_size,
/* timeout_ms = */ 5000, kudu::RpcLineItemDAO::RANGE,
/* num_buckets = */ 1));
dao->Init();