Marton Greber has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/19272 )

Change subject: KUDU-1945 Auto-Incrementing Column, C++ client
......................................................................


Patch Set 21:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/client.cc
File src/kudu/client/client.cc:

http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/client.cc@1542
PS20, Line 1542:   return spec;
               : }
               :
               : Kud
> Not sure if we should return "spec" or null? Where "spec" is released in ca
Refactored a checks, such that I moved all the verification logic into: 
KuduTableAlterer::Data::ToRequest(AlterTableRequestPB* req)
This way this problem doesnt exist.


http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/client.cc@1554
PS20, Line 1554: Data::Step s = { AlterTableRequestPB::DROP_COLUMN,
> Not sure if we should disable altering all properties of auto-incrementing
Yepp, as explained above, this checks are also moved into 
KuduTableAlterer::Data::ToRequest(AlterTableRequestPB* req)
where we can check individually.


http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/schema.cc
File src/kudu/client/schema.cc:

http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/schema.cc@566
PS20, Line 566: Data() : key_cols_unique(true) {
              :   }
> nit: don't need to split as two lines, one extra space after ":"
Done


http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/session-internal.cc
File src/kudu/client/session-internal.cc:

http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/session-internal.cc@373
PS20, Line 373: if (op.row().schema()->has_auto_incrementing()) {
              :     return Status::IllegalState(
> nit: call op.row().schema()->has_auto_incrementing() instead
Done


http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/session-internal.cc@376
PS20, Line 376: op.ToString()));
> nit: log the WriteOperation type in the message
This function is used down below, in ValidateWriteOperation, where it is used 
like:

RETURN_NOT_OK_ADD_ERROR(CheckForAutoIncrementingColumn, op, error_collector_);

This contains the write op. Here is a resulting example message, in case of an 
UPSERT:

"Illegal state: write operation is not supported on tables with non-unique 
primary key: UPSERT int32 key=1"


http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/client/session-internal.cc@376
PS20, Line 376:
> nit: Should we change to "table with auto-incrementing column"?
My take is the following:
Users interact with non-unique key in schema builder for example.
We are not expecting them to know much about the auto incrementing column.
Thats why I think it's better to give message using non-uniqe primary key in it.
(this they can change, the auto incrementing column not)

Let me know if it would be better to change this.


http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/common/schema.h
File src/kudu/common/schema.h:

http://gerrit.cloudera.org:8080/#/c/19272/20/src/kudu/common/schema.h@1048
PS20, Line 1048: auto_incrementi
> nit: it's better to name variable in the same style as other variables in t
Done



--
To view, visit http://gerrit.cloudera.org:8080/19272
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic133e3d44cc56c8351e33d95b523ed7b6b13617b
Gerrit-Change-Number: 19272
Gerrit-PatchSet: 21
Gerrit-Owner: Marton Greber <[email protected]>
Gerrit-Reviewer: Abhishek Chennaka <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Marton Greber <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
Gerrit-Comment-Date: Mon, 23 Jan 2023 15:09:44 +0000
Gerrit-HasComments: Yes

Reply via email to