This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch branch-1.17.x in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/branch-1.17.x by this push: new 49b4d5729 [Tools] Remove enter key when listing non-existed table 49b4d5729 is described below commit 49b4d572908d97d55589effe1193e71b80799a86 Author: xinghuayu007 <1450306...@qq.com> AuthorDate: Sun Feb 12 15:51:52 2023 +0800 [Tools] Remove enter key when listing non-existed table When Kudu listing a non-existed table using command line tool, it ouputs an enter key and a new line appears. But earlier version does not output an enter key. Therefore it is better to be compatible with old versions of Kudu. Change-Id: I86fafc3c7df26d380b424b6d6b3f80a1b8d78dc8 Reviewed-on: http://gerrit.cloudera.org:8080/19493 Tested-by: Kudu Jenkins Reviewed-by: Yingchun Lai <laiyingc...@apache.org> Reviewed-by: Yuqi Du <shenxingwuy...@gmail.com> Reviewed-by: Yifan Zhang <chinazhangyi...@163.com> Reviewed-on: http://gerrit.cloudera.org:8080/19577 Tested-by: Alexey Serbin <ale...@apache.org> Reviewed-by: Alexey Serbin <ale...@apache.org> --- src/kudu/tools/kudu-admin-test.cc | 3 +-- src/kudu/tools/tool_action_table.cc | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kudu/tools/kudu-admin-test.cc b/src/kudu/tools/kudu-admin-test.cc index 3e12c7e0a..8c5eca346 100644 --- a/src/kudu/tools/kudu-admin-test.cc +++ b/src/kudu/tools/kudu-admin-test.cc @@ -1763,8 +1763,7 @@ TEST_F(AdminCliTest, TestListSoftDeletedTables) { }, &stdout)); vector<string> stdout_lines = Split(stdout, ",", strings::SkipEmpty()); - ASSERT_EQ(1, stdout_lines.size()); - ASSERT_EQ("\n", stdout_lines[0]); + ASSERT_TRUE(stdout_lines.empty()); ASSERT_OK(RunKuduTool({ "table", diff --git a/src/kudu/tools/tool_action_table.cc b/src/kudu/tools/tool_action_table.cc index a8987029f..9cc084bc5 100644 --- a/src/kudu/tools/tool_action_table.cc +++ b/src/kudu/tools/tool_action_table.cc @@ -358,7 +358,9 @@ class TableLister { } if (iequals(FLAGS_list_table_output_format, "pretty")) { - cout << ToPrettyFormat(tables_info_pb) << endl; + if (!tables_info_pb.tables().empty()) { + cout << ToPrettyFormat(tables_info_pb) << endl; + } } else { DCHECK(iequals(FLAGS_list_table_output_format, "json") || iequals(FLAGS_list_table_output_format, "json_compact"));