Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/19677 )
Change subject: KUDU-1945 Auto-incrementing column, Python client ...................................................................... KUDU-1945 Auto-incrementing column, Python client This patch adds the Python part of the client side changes for the auto incrementing column feature. A new ColumnSpec called non_unique_primary_key is added. Semantically it behaves like primary_key: - only one column can have the non_unique_primary_key ColumnSpec in a given SchemaBuilder 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 column together form the effective primary key. Some technical notes: - The name of the auto incrementing column is hardcoded into the kudu.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 kudu.Schema.get_auto_incrementing_column_name(). - In this initial version there is no support for UPSERT and UPSERT_IGNORE operations. - With non-unique primary key, one can't use the tuple/list initialization for new inserts. Change-Id: I94622680c5eb32eb2746a3b84c73699c1a37618c Reviewed-on: http://gerrit.cloudera.org:8080/19566 Tested-by: Kudu Jenkins Reviewed-by: Abhishek Chennaka <[email protected]> Reviewed-by: Yingchun Lai <[email protected]> Reviewed-by: Alexey Serbin <[email protected]> (cherry picked from commit 80a18400024d36f84c7fa53eac0fba8e2f8b726d) Reviewed-on: http://gerrit.cloudera.org:8080/19677 --- M python/kudu/libkudu_client.pxd M python/kudu/schema.pyx M python/kudu/tests/test_client.py M python/kudu/tests/test_scantoken.py M python/kudu/tests/test_schema.py 5 files changed, 494 insertions(+), 4 deletions(-) Approvals: Kudu Jenkins: Verified Yingchun Lai: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/19677 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: branch-1.17.x Gerrit-MessageType: merged Gerrit-Change-Id: I94622680c5eb32eb2746a3b84c73699c1a37618c Gerrit-Change-Number: 19677 Gerrit-PatchSet: 3 Gerrit-Owner: Alexey Serbin <[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: Yingchun Lai <[email protected]>
