Will Berkeley has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/12167 )
Change subject: [tools] Add table scan tool
......................................................................
[tools] Add table scan tool
This commit adds a basic tool to scan rows from a table. Several
predicates can specified on the query. Unlike traditional SQL
syntax, the scan tool's simple query predicates are represented in a
simple JSON syntax. Three types of predicates are supported, including
'Comparison', 'InList' and 'IsNull'.
* The 'Comparison' type support <=, <, ==, > and >=,
which can be represented as '[operator, column_name, value]',
e.g. '[">=", "col1", "value"]'
* The 'InList' type can be represented as
'["IN", column_name, [value1, value2, ...]]'
e.g. '["IN", "col2", ["value1", "value2"]]'
* The 'IsNull' type determine whether the value is NULL or not,
which can be represented as '[operator, column_name]'
e.g. '["NULL", "col1"]', or '["NOTNULL", "col2"]'
Predicates can be combined together with predicate operators using the syntax
[operator, predicate, predicate, ..., predicate].
For example,
["AND", [">=", "col1", "value"], ["NOTNULL", "col2"]]
The only supported predicate operator is `AND`.
Change-Id: Ieac340b70a9eaf131f82a2b7d61336211d1d48f8
Reviewed-on: http://gerrit.cloudera.org:8080/12167
Tested-by: Kudu Jenkins
Reviewed-by: Will Berkeley <[email protected]>
---
M src/kudu/client/scanner-internal.h
M src/kudu/tools/CMakeLists.txt
M src/kudu/tools/kudu-tool-test.cc
A src/kudu/tools/table_scanner.cc
A src/kudu/tools/table_scanner.h
M src/kudu/tools/tool_action_cluster.cc
M src/kudu/tools/tool_action_common.cc
M src/kudu/tools/tool_action_perf.cc
M src/kudu/tools/tool_action_table.cc
9 files changed, 697 insertions(+), 32 deletions(-)
Approvals:
Kudu Jenkins: Verified
Will Berkeley: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/12167
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieac340b70a9eaf131f82a2b7d61336211d1d48f8
Gerrit-Change-Number: 12167
Gerrit-PatchSet: 21
Gerrit-Owner: Yingchun Lai <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Will Berkeley <[email protected]>
Gerrit-Reviewer: Yingchun Lai <[email protected]>