Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-1792

It is possible to overwrite range partitions with new ones

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0
    • None
    • None

    Description

      In a table with open ended partitions it is possible to overwrite the one at the upper end with a partition that matches its boundary element.

      Here's the output of how to repro this. The show range partitions command has not been merged into the Impala codebase, but it reflects the output of the getFormattedRangePartitions() API call.

      [localhost:21000] > create table lt (id int primary key, name string null, vali bigint not null)
        distribute by range (id) (partition 1 < values <= 10) stored as kudu
        tblproperties('kudu.table_name'='lt');
      Query: create table lt (id int primary key, name string null, vali bigint not null)
        distribute by range (id) (partition 1 < values <= 10) stored as kudu
        tblproperties('kudu.table_name'='lt')
      
      Fetched 0 row(s) in 0.24s
      [localhost:21000] > show range partitions lt;
      Query: show range partitions lt
      +---------------------+
      | Partition Specifier |
      +---------------------+
      | 2 <= VALUES < 11    |
      +---------------------+
      Fetched 1 row(s) in 4.27s
      [localhost:21000] > alter table lt add range partition values < 2;
      Query: alter table lt add range partition values < 2
      
      Fetched 0 row(s) in 0.22s
      [localhost:21000] > show range partitions lt;
      Query: show range partitions lt
      +---------------------+
      | Partition Specifier |
      +---------------------+
      | VALUES < 2          |
      | 2 <= VALUES < 11    |
      +---------------------+
      Fetched 2 row(s) in 0.01s
      [localhost:21000] > alter table lt add range partition 11 <= values;
      Query: alter table lt add range partition 11 <= values
      
      Fetched 0 row(s) in 0.44s
      [localhost:21000] > alter table lt add range partition 11 <= values < 16;
      Query: alter table lt add range partition 11 <= values < 16
      
      Fetched 0 row(s) in 0.56s
      [localhost:21000] > show range partitions lt;
      Query: show range partitions lt
      +---------------------+
      | Partition Specifier |
      +---------------------+
      | VALUES < 2          |
      | 2 <= VALUES < 11    |
      | 11 <= VALUES < 16   |
      +---------------------+
      Fetched 3 row(s) in 0.01s
      

      Attachments

        Issue Links

          Activity

            People

              danburkert Dan Burkert
              lv Lars Volker
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: