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 <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <[email protected]>
Gerrit-Comment-Date: Wed, 03 Apr 2019 09:15:10 +0000
Gerrit-HasComments: Yes

Reply via email to