apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.64k stars 3.26k forks source link

[Bug] Can't add partitons to a table which has "colocate_with" property #4753

Open wyndia opened 4 years ago

wyndia commented 4 years ago

Describe the bug

Version: Apache Doris 0.12.0-rc03

To Reproduce

  1. Create a table:
    CREATE TABLE `test` (
                           `date` date,
                           `userid` varchar(128)
    ) ENGINE=OLAP
    DUPLICATE KEY(`date`, `userid`)
    PARTITION BY RANGE(`date`)()
    DISTRIBUTED BY HASH(`userid`) BUCKETS 8
    PROPERTIES (
               "colocate_with" = "test"
           );
  2. Try to add a partition:
    ALTER TABLE test add PARTITION p1 VALUES [("2020-10-15"), ("2020-10-16"));
  3. See the error:
    ERROR 1064 (HY000): Unexpected exception: null
EmmyMiao87 commented 4 years ago

The main reason for this is because your partition does not specify a range, so it is not a partitioned table

HappenLee commented 4 years ago

@wyndia Hi,I check this problem. because you create table with empty partition of date, this cause the colocatebalancer get null pointer.

it is easy to avoid this bug:

  1. create table with unless one valid partition. do not empty partition and add partition later
  2. use dynamic_partition.
morningman commented 4 years ago

@wyndia Hi,I check this problem. because you create table with empty partition of date, this cause the colocatebalancer get null pointer.

it is easy to avoid this bug:

  1. create table with unless one valid partition. do not empty partition and add partition later
  2. use dynamic_partition.

i think this is a bug, we should fix it