Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-11906

Impala Doc: Support non unique primary key for Kudu table

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 4.3.0
    • Impala 4.3.0
    • Docs
    • ghx-label-11

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              shajini shajini thayasingh
              wzhou Wenzhe Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: