Alexey Serbin has submitted this change and it was merged. (
http://gerrit.cloudera.org:8080/24290 )
Change subject: [tools] fix `table add_column` failing to add DECIMAL/VARCHAR
columns
......................................................................
[tools] fix `table add_column` failing to add DECIMAL/VARCHAR columns
`kudu table add_column` does not correctly support DECIMAL
or VARCHAR columns.
The CLI never forwards precision/scale/length attributes to
KuduColumnSpec, even though the `table create` JSON path
already handles type_attributes correctly in
ParseTableSchema().
The following invocations currently fail:
kudu table add_column <m> <t> c DECIMAL
kudu table add_column <m> <t> c "DECIMAL(10,2)"
kudu table add_column <m> <t> c VARCHAR
Propagate precision/scale/length through the AddColumn()
code path via three new optional flags:
--column_precision, --column_scale, and --column_length.
Missing required attributes are now rejected client-side
with a clear error message pointing to the required flag,
instead of the previous server-side "no precision provided"
error.
Drive-by: remove "TIMESTAMP" from the kDataTypeArg help
text. Kudu uses UNIXTIME_MICROS instead, and
StringToDataType() does not recognize TIMESTAMP.
Adds regression tests covering both DECIMAL and VARCHAR
success paths, along with missing-attribute validation.
Change-Id: I4cf3cc23d1bc972c48bbc4a579503b13aad47655
Reviewed-on: http://gerrit.cloudera.org:8080/24290
Tested-by: Alexey Serbin <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
M src/kudu/tools/kudu-tool-test.cc
M src/kudu/tools/tool_action_table.cc
2 files changed, 142 insertions(+), 3 deletions(-)
Approvals:
Alexey Serbin: Looks good to me, approved; Verified
--
To view, visit http://gerrit.cloudera.org:8080/24290
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4cf3cc23d1bc972c48bbc4a579503b13aad47655
Gerrit-Change-Number: 24290
Gerrit-PatchSet: 3
Gerrit-Owner: Yan-Daojiang <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Gabriella Lotz <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Yan-Daojiang <[email protected]>
Gerrit-Reviewer: Zoltan Martonka <[email protected]>