[ 
https://issues.apache.org/jira/browse/IMPALA-11906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686108#comment-17686108
 ] 

shajini thayasingh commented on IMPALA-11906:
---------------------------------------------

[~wzhou] since we have started supporting non unique primary key for Kudu 
table, we must update the [existing page 
|https://impala.apache.org/docs/build/html/topics/impala_kudu.html]that 
specifically calls out that the columns must be unique. So I would like someone 
to review the existing page and provide me the details of the changes needed in 
the current contents. Once thats is done we shall add this new support to the 
existing topic.

> Impala Doc: Support non unique primary key for Kudu table
> ---------------------------------------------------------
>
>                 Key: IMPALA-11906
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11906
>             Project: IMPALA
>          Issue Type: Documentation
>          Components: Docs
>    Affects Versions: Impala 4.3.0
>            Reporter: Wenzhe Zhou
>            Assignee: shajini thayasingh
>            Priority: Major
>              Labels: documentation
>
> IMPALA-11809 Added support non unique primary key for Kudu table. We should 
> document the syntax for non unique primary key.
> - We added syntactic support for creating Kudu table with non unique primary 
> key.
>   For example: 
>     CREATE TABLE tbl (id INT NON UNIQUE PRIMARY KEY, name STRING)
>     PARTITION BY HASH (id) PARTITIONS 3
>     STORED as KUDU;
>   More samples could be found in the commit messages of 
> https://issues.apache.org/jira/browse/IMPALA-11809
> - Kudu engine appends a system generated auto-incrementing column to the non 
> unique primary key columns to guarantee the uniqueness on primary key. This 
> auto-incrementing column is named as 'auto_incrementing_id' with bigint type. 
> The assignment to it during insertion is automatic.
> 'auto_incrementing_id' column cannot be added, removed or renamed with ALTER 
> TABLE statements.
> - When creating a Kudu table, specifying PRIMARY KEY is optional now. If 
> there is no primary key attribute specified, the partition key columns could 
> be promoted as non unique primary key if those columns are the beginning 
> columns of the table.
> In following sample, 'a' and 'b' will be promoted as non unique primary key, 
> 'auto_incrementing_id' column will be added by Kudu engine.  'a', 'b' and 
> 'auto_incrementing_id' form the effective unique composite primary key.
>     CREATE TABLE tbl (a INT, b STRING, c FLOAT)
>      PARTITION BY HASH (a, b) PARTITIONS 3
>      STORED as KUDU;
> - New column "key_unique" is added to the output of 'describe' table command 
> for Kudu table, which shows if the primary key is unique.
> -  SELECT statement does not show the system generated auto-incrementing 
> column unless the column is explicitly specified in the select list.
> - UPSERT operation is not supported for Kudu tables with non unique primary 
> key.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to