You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "helifu (Code Review)" <ge...@cloudera.org> on 2019/03/29 06:09:32 UTC
[kudu-CR] java: ColumnSchema supports storing column comment
helifu has uploaded this change for review. ( http://gerrit.cloudera.org:8080/12890
Change subject: java: ColumnSchema supports storing column comment
......................................................................
java: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And, the server-side has already
been implemented in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
6 files changed, 156 insertions(+), 10 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/1
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 7: Code-Review+1
LGTM but I will let Adar review too.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 7
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 03:08:36 +0000
Gerrit-HasComments: No
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 4:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/12890/3/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
File java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java:
http://gerrit.cloudera.org:8080/#/c/12890/3/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@144
PS3, Line 144: if (pb.hasComment()) {
> You don't need the duplication. Try this:
Done
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/common/wire_protocol.cc
File src/kudu/common/wire_protocol.cc:
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/common/wire_protocol.cc@307
PS3, Line 307: std::move(comment)
> I think you may be able to omit L300-302 and just pass pb.comment() here. I
Yeah, it's cool. Thanks!
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/master/catalog_manager.cc
File src/kudu/master/catalog_manager.cc:
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/master/catalog_manager.cc@1343
PS3, Line 1343: return Status::OK();
> This depends on whether we're creating or altering, right? Isn't the empty
No, there is no need to distinguish between creating and modifying a table. Please review the code L1439/1441 and Line2474/2483.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 4
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 10:04:13 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#6).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 244 insertions(+), 75 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/6
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 6
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 2:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@401
PS2, Line 401: * Set the comment for this column.
> What does empty string mean? Should it be allowed?
Done
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@365
PS2, Line 365: * Change the comment for the column.
> Should doc what effect empty string has (it's for deleting an existing comm
Done
http://gerrit.cloudera.org:8080/#/c/12890/2/src/kudu/common/wire_protocol.cc
File src/kudu/common/wire_protocol.cc:
http://gerrit.cloudera.org:8080/#/c/12890/2/src/kudu/common/wire_protocol.cc@309
PS2, Line 309: attributes, type_attributes, std::move(comment));
> Now that empty string means "no comment", I don't think we need boost::opti
Yeah, the boost::optional of comment_ in class ColumnSchema can be deleted.
But in class KuduColumnSpec::Data & struct ColumnSchemaDelta they can't, because both of them need to represent three states while altering a table:
1) "user didn't ask us to modify the comment"
2) "user asked us to modify the comment"
3) "user asked us to delete the comment"
----------------------------------------------
In addition, c++ client uses the same class/struct to store the changes for creating and altering table, but java client does not.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 2
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 03:46:34 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Reviewed-on: http://gerrit.cloudera.org:8080/12890
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 199 insertions(+), 66 deletions(-)
Approvals:
Kudu Jenkins: Verified
Adar Dembo: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 11
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@213
PS1, Line 213: public String getComment() {
> Maybe we need a consensus view of comment first:
I think Grant is proposing:
1. Logically, a comment must be a non-empty string.
2. Therefore, in our public API "no comment" is modeled as an empty string.
3. Therefore, in our public API there is no such thing as a NULL comment.
4. There are two possible actions a user can take:
4a. Adding a column comment means going from empty string to non-empty string.
4b. Deleting a column comment means going from non-empty string to empty string.
4c. If possible (and if not too challenging), we should try to optimize "no-op" comment changes (i.e. empty string to empty string, or "foo" to "foo") and not send them to the server.
I'm OK with this, and I hope it'll let us reduce some of the boost::optional complexity server-side (and C++ client-side). Do you think it'll help reduce complexity?
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Sun, 31 Mar 2019 18:53:09 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 6:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/12890/6/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/6/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@408
PS6, Line 408: throw new IllegalArgumentException("The comment should not be empty");
> I don't think we need this check. A user can set an empty comment and it sh
Done
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.h
File src/kudu/client/schema.h:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.h@445
PS6, Line 445: /// The comment for the column. An empty comment means deleting an
> I think you can keep the docs as simple as "The comment for the column."
Done
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.cc
File src/kudu/client/schema.cc:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.cc@314
PS6, Line 314: return Status::InvalidArgument("cannot delete comment during CreateTable",
> See my other comments on ColumnSchema.java and schema.h.
Done
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/common/schema.h
File src/kudu/common/schema.h:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/common/schema.h@347
PS6, Line 347: // "empty comment" means "no comment".
> nit: I don't think you need this doc line here.
Done
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/server/webui_util.cc
File src/kudu/server/webui_util.cc:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/server/webui_util.cc@53
PS6, Line 53: col_json["comment"] = !col.comment().empty() ? col.comment() : "-";
> I don't think we need the empty check here. In the case the comment is empt
Done
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 6
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 02:48:49 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 4:
Sorry for quickly retriggering the builder :(
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 4
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 09:18:59 +0000
Gerrit-HasComments: No
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 10: Code-Review+2
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 10
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Fri, 05 Apr 2019 01:00:15 +0000
Gerrit-HasComments: No
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 9:
(2 comments)
Looks good, just two typos.
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/client/schema.h
File src/kudu/client/schema.h:
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/client/schema.h@247
PS9, Line 247: /// @note An empty string will return if there is no comment.
"@note An empty string will be returned if there is no comment."
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/common/wire_protocol.cc
File src/kudu/common/wire_protocol.cc:
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/common/wire_protocol.cc@301
PS9, Line 301: regardles
regardless
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 9
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 17:57:49 +0000
Gerrit-HasComments: Yes
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(10 comments)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@213
PS1, Line 213: public String getComment() {
> Maybe we could default to empty string instead of null. It might make users
I think Lifu is mirroring a choice we made on the C++ side to treat "empty string" as a valid comment, which means "no comment" has to map to something else (like null).
We can certainly revisit that choice as we haven't shipped anything yet, but we should make sure that whatever we do is consistent across both clients.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
PS1:
Please check the wrapping on the modified lines; some are over 100 characters.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@367
PS1, Line 367: public AlterTableOptions ChangeComment(String name, String comment) {
Nit: should be named changeComment().
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@368
PS1, Line 368: if (comment == null) {
> Since setting a null comment isn't allowed, it makes more sense to default
Well, we do we want to support _deleting_ a column, right? Wouldn't we model that as setting the comment back to null?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@375
PS1, Line 375: AlterTableRequestPB.AlterColumn.newBuilder();
There are some tabs here and on L377; please convert to spaces.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
File java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java@283
PS1, Line 283: requestBuilder.setSchema(ProtobufHelper.schemaToPb(schema, SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
> Why can't the schema have a comment in this case? Is this just to save spac
Yeah. A Write's schema ends up in the WAL, so there's no point in inflating it with the comments belonging to every column. Lifu did the same thing in the C++ client.
A code comment explaining that would be good though.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
File java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@45
PS1, Line 45: * The flags that are not included while serializing.
I think you can simplify this a bit:
- Don't bother setting up SCHEMA_PB_WITHOUT_NONE.
- Don't bother assigning a value to each flag.
- Pass flags around with an EnumSet. Use EnumSet.noneOf() to represent "serialize everything".
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@47
PS1, Line 47: @InterfaceAudience.Public
: @InterfaceStability.Evolving
I don't think you need these given that it's in a class that's marked @Private already.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@49
PS1, Line 49: public enum SchemaPBFlags {
Maybe SchemaPBConversionFlags would be more clear?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
File java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java@749
PS1, Line 749: // Change the comments to null.
It should be possible to "delete" a comment too; we should test that (and in the C++ side too).
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 29 Mar 2019 21:50:20 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 6:
Note: This has a merge conflict. You should rebase on master when you update the patch.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 6
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 20:47:17 +0000
Gerrit-HasComments: No
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@213
PS1, Line 213: public String getComment() {
> I think Lifu is mirroring a choice we made on the C++ side to treat "empty
Apologies I didn't review that earlier patch.
For me, null really needs to have a good purpose to be used. Otherwise it leads to bugs/exceptions for little good reason. What would the value of having a null column comment vs and empty string be?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@368
PS1, Line 368: if (comment == null) {
> Well, we do we want to support _deleting_ a column, right? Wouldn't we mode
Sure, if that is the decisions. I was just noting how this "comment cannot be null" check backs up my claim about null columns comments.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
File java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java@749
PS1, Line 749: // Change the comments to null.
> It should be possible to "delete" a comment too; we should test that (and i
I really think setting to an empty string should be okay and null comments don't need to be a thing.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 29 Mar 2019 21:55:22 +0000
Gerrit-HasComments: Yes
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@213
PS1, Line 213: public String getComment() {
> Apologies I didn't review that earlier patch.
Maybe we need a consensus view of comment first:
1) Is "empty comment" valid?
2) Whether deleting comment is supported?
3) Should we add a new interface to replace "empty comment" for deleting comment?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@368
PS1, Line 368: if (comment == null) {
> Well, we do we want to support _deleting_ a column, right? Wouldn't we mode
I am sorry i cannot catch your meaning here :(
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
File java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java@283
PS1, Line 283: requestBuilder.setSchema(ProtobufHelper.schemaToPb(schema, SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
> This makes sense. Even if a client sends a comment, we should probably stri
I am afraid it is not a good idea for servers to focus on stripping comments to avoid WAL bloating, and more importantly that will bring a noticeable effect on WAL performance.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Sun, 31 Mar 2019 08:07:22 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#10).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 199 insertions(+), 66 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/10
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 10
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@213
PS1, Line 213: public String getComment() {
Maybe we could default to empty string instead of null. It might make users code a bit easier.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@244
PS1, Line 244: if (comment != null) {
If we default to "" this check wont be needed.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@296
PS1, Line 296: pb.setSchema(ProtobufHelper.schemaToPb(lowerBound.getSchema(), SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
Why can't the schema have a comment in this case?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@355
PS1, Line 355: pb.setSchema(ProtobufHelper.schemaToPb(lowerBound.getSchema(), SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
Why can't the schema have a comment in this case?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@368
PS1, Line 368: if (comment == null) {
Since setting a null comment isn't allowed, it makes more sense to default to empty string in the other places I mentioned.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
File java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java@283
PS1, Line 283: requestBuilder.setSchema(ProtobufHelper.schemaToPb(schema, SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
Why can't the schema have a comment in this case? Is this just to save space?
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
File java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@150
PS1, Line 150: String comment = pb.hasComment() ? pb.getComment() : null;
default empty string "".
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Fri, 29 Mar 2019 13:01:49 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 7:
Oh, I think you still need to rebase.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 7
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 03:08:48 +0000
Gerrit-HasComments: No
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#9).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 200 insertions(+), 67 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/9
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 9
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 7:
Yeah, i will rebase on master after this modification. :)
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 7
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 03:10:57 +0000
Gerrit-HasComments: No
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
File java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java@283
PS1, Line 283: requestBuilder.setSchema(ProtobufHelper.schemaToPb(schema, SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
> Yeah. A Write's schema ends up in the WAL, so there's no point in inflating
This makes sense. Even if a client sends a comment, we should probably strip it server side to avoid WAL bloat.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sat, 30 Mar 2019 15:15:14 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#3).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 241 insertions(+), 61 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/3
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 3
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has removed a vote on this change.
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Removed Verified-1 by Kudu Jenkins (120)
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 9
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 9: Verified+1
An unrelated Java flaky.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 9
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 17:10:55 +0000
Gerrit-HasComments: No
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#7).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 197 insertions(+), 65 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/7
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 7
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#8).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 200 insertions(+), 67 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/8
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 8
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#4).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 241 insertions(+), 61 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/4
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 4
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 9:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/client/schema.h
File src/kudu/client/schema.h:
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/client/schema.h@247
PS9, Line 247: /// @note An empty string will return if there is no comment.
> "@note An empty string will be returned if there is no comment."
Done
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/common/wire_protocol.cc
File src/kudu/common/wire_protocol.cc:
http://gerrit.cloudera.org:8080/#/c/12890/9/src/kudu/common/wire_protocol.cc@301
PS9, Line 301: regardles
> regardless
Done
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 9
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Thu, 04 Apr 2019 23:30:17 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 6:
(5 comments)
Thank you for all the work on this helifu.
http://gerrit.cloudera.org:8080/#/c/12890/6/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/6/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@408
PS6, Line 408: throw new IllegalArgumentException("The comment should not be empty");
I don't think we need this check. A user can set an empty comment and it should be okay. Especially because empty is the default.
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.h
File src/kudu/client/schema.h:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.h@445
PS6, Line 445: /// The comment for the column. An empty comment means deleting an
I think you can keep the docs as simple as "The comment for the column."
I don't think we need to view "empty comment" as s special deleting operation. Because we default to "", the only thing you need to worry about is "setting" a comment. Whether it's setting it to "some new string" or setting it to "", then end result is the user set a string for the comment.
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.cc
File src/kudu/client/schema.cc:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/client/schema.cc@314
PS6, Line 314: return Status::InvalidArgument("cannot delete comment during CreateTable",
See my other comments on ColumnSchema.java and schema.h.
I don't think we need to prevent users from "setting" a column to an empty string.
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/common/schema.h
File src/kudu/common/schema.h:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/common/schema.h@347
PS6, Line 347: // "empty comment" means "no comment".
nit: I don't think you need this doc line here.
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/server/webui_util.cc
File src/kudu/server/webui_util.cc:
http://gerrit.cloudera.org:8080/#/c/12890/6/src/kudu/server/webui_util.cc@53
PS6, Line 53: col_json["comment"] = !col.comment().empty() ? col.comment() : "-";
I don't think we need the empty check here. In the case the comment is empty, we can still display it that way.
It may also be confusing if a user sets a column comment of "-" themselves.
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 6
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 13:33:47 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 3:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/12890/3/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
File java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java:
http://gerrit.cloudera.org:8080/#/c/12890/3/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@144
PS3, Line 144: if (pb.hasComment()) {
You don't need the duplication. Try this:
ColumnSchema.ColumnSchemaBuilder builder = new ColumnSchema.ColumnSchemaBuilder(...).key(...)...
if (pb.hasComment()) {
builder = builder.comment(pb.getComment());
}
return builder.build();
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/common/wire_protocol.cc
File src/kudu/common/wire_protocol.cc:
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/common/wire_protocol.cc@307
PS3, Line 307: std::move(comment)
I think you may be able to omit L300-302 and just pass pb.comment() here. IIUC the default value for strings in protobuf is the empty string, so the pb has something "valid" regardless of whether has_comment() is true or false.
See https://developers.google.com/protocol-buffers/docs/proto#optional for more details.
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/master/catalog_manager.cc
File src/kudu/master/catalog_manager.cc:
http://gerrit.cloudera.org:8080/#/c/12890/3/src/kudu/master/catalog_manager.cc@1343
PS3, Line 1343: return Status::OK();
This depends on whether we're creating or altering, right? Isn't the empty string only valid for the latter?
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 3
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Wed, 03 Apr 2019 09:15:10 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#5).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/schema.h
M src/kudu/common/wire_protocol.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/server/webui_util.cc
14 files changed, 244 insertions(+), 74 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/5
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 5
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12890
to look at the new patch set (#2).
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
java/c++: ColumnSchema supports storing column comment
This patch intends to add a new api for storing column
comment in java client. And according to the comments
of the reviews, the empty comment is defined to delete
the comment for the uniform behavior.
In addition, the server-side has already been implemented
in: https://gerrit.cloudera.org/#/c/12849/
Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
---
M java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
M java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
M java/kudu-client/src/main/java/org/apache/kudu/client/Operation.java
M java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
M java/kudu-client/src/test/java/org/apache/kudu/TestColumnSchema.java
M java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
M src/kudu/client/client-test.cc
M src/kudu/client/schema.cc
M src/kudu/client/schema.h
M src/kudu/common/schema.cc
M src/kudu/common/wire_protocol.cc
11 files changed, 185 insertions(+), 27 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/12890/2
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 2
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
[kudu-CR] java: ColumnSchema supports storing column comment
Posted by "helifu (Code Review)" <ge...@cloudera.org>.
helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java: ColumnSchema supports storing column comment
......................................................................
Patch Set 1:
(14 comments)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@213
PS1, Line 213: public String getComment() {
> I think Grant is proposing:
Sure. Thanks, Adar :)
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@244
PS1, Line 244: if (comment != null) {
> If we default to "" this check wont be needed.
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
PS1:
> Please check the wrapping on the modified lines; some are over 100 characte
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@296
PS1, Line 296: pb.setSchema(ProtobufHelper.schemaToPb(lowerBound.getSchema(), SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
> Why can't the schema have a comment in this case?
The comment is useless for adding range partition.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@355
PS1, Line 355: pb.setSchema(ProtobufHelper.schemaToPb(lowerBound.getSchema(), SchemaPBFlags.SCHEMA_PB_WITHOUT_COMMENT));
> Why can't the schema have a comment in this case?
Likewise, the comment is useless for dropping range partition.
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@367
PS1, Line 367: public AlterTableOptions ChangeComment(String name, String comment) {
> Nit: should be named changeComment().
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@368
PS1, Line 368: if (comment == null) {
> Since setting a null comment isn't allowed, it makes more sense to default
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@375
PS1, Line 375: AlterTableRequestPB.AlterColumn.newBuilder();
> There are some tabs here and on L377; please convert to spaces.
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java
File java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@45
PS1, Line 45: * The flags that are not included while serializing.
> I think you can simplify this a bit:
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@47
PS1, Line 47: @InterfaceAudience.Public
: @InterfaceStability.Evolving
> I don't think you need these given that it's in a class that's marked @Priv
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@49
PS1, Line 49: public enum SchemaPBFlags {
> Maybe SchemaPBConversionFlags would be more clear?
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/main/java/org/apache/kudu/client/ProtobufHelper.java@150
PS1, Line 150: String comment = pb.hasComment() ? pb.getComment() : null;
> default empty string "".
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java
File java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java:
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java@749
PS1, Line 749: // Change the comments to null.
> I really think setting to an empty string should be okay and null comments
Done
http://gerrit.cloudera.org:8080/#/c/12890/1/java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduTable.java@749
PS1, Line 749: // Change the comments to null.
> It should be possible to "delete" a comment too; we should test that (and i
Done
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 1
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Tue, 02 Apr 2019 10:21:25 +0000
Gerrit-HasComments: Yes
[kudu-CR] java/c++: ColumnSchema supports storing column comment
Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12890 )
Change subject: java/c++: ColumnSchema supports storing column comment
......................................................................
Patch Set 2:
(3 comments)
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java
File java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java:
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/ColumnSchema.java@401
PS2, Line 401: * Set the comment for this column.
What does empty string mean? Should it be allowed?
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java
File java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java:
http://gerrit.cloudera.org:8080/#/c/12890/2/java/kudu-client/src/main/java/org/apache/kudu/client/AlterTableOptions.java@365
PS2, Line 365: * Change the comment for the column.
Should doc what effect empty string has (it's for deleting an existing comment, right?).
http://gerrit.cloudera.org:8080/#/c/12890/2/src/kudu/common/wire_protocol.cc
File src/kudu/common/wire_protocol.cc:
http://gerrit.cloudera.org:8080/#/c/12890/2/src/kudu/common/wire_protocol.cc@309
PS2, Line 309: attributes, type_attributes, std::move(comment));
Now that empty string means "no comment", I don't think we need boost::optional wrappers around comment fields at all: the empty string will tell us that there's no column comment.
The only exception is in ColumnSchemaDelta, where we need explicit optionality in order to tell the difference between "user didn't ask us to modify the comment field" and "user asked us to delete the existing comment".
--
To view, visit http://gerrit.cloudera.org:8080/12890
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4cdca4101898062cfe154c15ca40c5943d0e343c
Gerrit-Change-Number: 12890
Gerrit-PatchSet: 2
Gerrit-Owner: helifu <hz...@corp.netease.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <hz...@corp.netease.com>
Gerrit-Comment-Date: Tue, 02 Apr 2019 17:44:11 +0000
Gerrit-HasComments: Yes