YangSong has posted comments on this change. ( http://gerrit.cloudera.org:8080/14306 )
Change subject: add a tool to create table ...................................................................... Patch Set 5: (2 comments) The test code can define a new function to avoid repeating the same code over and over. http://gerrit.cloudera.org:8080/#/c/14306/5/src/kudu/tools/tool_action_table.cc File src/kudu/tools/tool_action_table.cc: http://gerrit.cloudera.org:8080/#/c/14306/5/src/kudu/tools/tool_action_table.cc@937 PS5, Line 937: ParseValueOfType(column.default_value(), > Wrap in RETURN_NOT_OK. I find there is a problem here. I can't use ParseValueOfType derictly, there are two problems: 1. the string should convert to list, like ["1"] or [1] 2. in the JSON object, the default value's type is always string, but if I directly convert it to list, like "[1]" as the first parameter, it only work at the type of int, if the type is string, we should convert "1" to "[\"1\"]". Here I add a piece of code: if (column.column_type() == "STRING" OR "BINARY") { default_v = "[\"" + column.default_value() + "\"]"; } else { default_v = "[" + column.default_value() + "]"; } Do you think this is right? Or better advice. ConvertToKuduPartialRow has the same problem. http://gerrit.cloudera.org:8080/#/c/14306/5/src/kudu/tools/tool_action_table.cc@970 PS5, Line 970: for (const auto& value : bound.lower_bound().bound_values()) { : values += value; : values += ","; : } > You should be able to use a function from gutil/strings/join.h here and bel I try to modify like this: string tmp = JoinKeysIterator( bound.lower_bound().bound_values().begin(), bound.lower_bound().bound_values().end(), ","); but error reported at compile time. Maybe the RepeatedPtrField iterator is not support. -- To view, visit http://gerrit.cloudera.org:8080/14306 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0bce4733a504f8ef5f024089a16fe3c6f1e493f1 Gerrit-Change-Number: 14306 Gerrit-PatchSet: 5 Gerrit-Owner: YangSong <sy1...@yeah.net> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Reviewer: YangSong <sy1...@yeah.net> Gerrit-Comment-Date: Sun, 29 Sep 2019 10:00:20 +0000 Gerrit-HasComments: Yes