Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19272 )
Change subject: KUDU-1945 Auto-Incrementing Column, C++ client ...................................................................... KUDU-1945 Auto-Incrementing Column, C++ client This patch adds the initial part of the cpp client side changes to the auto incrementing column feature. A new KuduColumnSpec called NonUniquePrimaryKey is added. Semantically it behaves like PrimaryKey: - only one column can have the NonUniquePrimaryKey ColumnSpec in a given KuduSchemaBuilder context, - if it exists, it must be defined in the first place, - compound keys are defined through a set function. Functionally non-unique primary keys don't need to fulfill the uniqueness constraint. An auto incrementing column is added in the background automatically once a non-unique primary key is specified. The non-unique keys and the auto incrementing columns together form the effective primary key. Some technical notes: - The name of the auto incrementing column is hardcoded into the Schema class. This is a reserved column name, users can't create columns with it. On the client facing side, this reserved string is reachable through: KuduSchema::GetAutoIncrementingColumnName(). - In this initial version there is no support for UPSERT and UPSERT_IGNORE operations. As suggested in the server side patch [1], a specific builder is added to construct the column spec for the auto incrementing column. Since this pins down the properties of the column, I took the liberty to remove unit tests and checks which verify these properties. [1] https://gerrit.cloudera.org/#/c/19097/ Change-Id: Ic133e3d44cc56c8351e33d95b523ed7b6b13617b Reviewed-on: http://gerrit.cloudera.org:8080/19272 Reviewed-by: Alexey Serbin <[email protected]> Reviewed-by: Abhishek Chennaka <[email protected]> Tested-by: Alexey Serbin <[email protected]> --- M src/kudu/client/client-test.cc M src/kudu/client/client-unittest.cc M src/kudu/client/client.h M src/kudu/client/scan_token-internal.cc M src/kudu/client/scan_token-test.cc M src/kudu/client/schema-internal.h M src/kudu/client/schema.cc M src/kudu/client/schema.h M src/kudu/client/session-internal.cc M src/kudu/client/table_alterer-internal.cc M src/kudu/common/partial_row.cc M src/kudu/common/partial_row.h M src/kudu/common/schema-test.cc M src/kudu/common/schema.cc M src/kudu/common/schema.h M src/kudu/integration-tests/auto_incrementing-itest.cc 16 files changed, 759 insertions(+), 196 deletions(-) Approvals: Alexey Serbin: Looks good to me, approved; Verified Abhishek Chennaka: Looks good to me, but someone else must approve -- 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: merged Gerrit-Change-Id: Ic133e3d44cc56c8351e33d95b523ed7b6b13617b Gerrit-Change-Number: 19272 Gerrit-PatchSet: 26 Gerrit-Owner: Marton Greber <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
