Issue with Hyphenated client_id Values in Partition Names

Hello StarRocks Community,

I’ve encountered an issue with partitioning in StarRocks (version 3.2) that seems to involve handling hyphenated client_id values. I was hoping to get some insights or solutions from anyone who might have faced a similar issue.

Steps to Reproduce the Behavior:

  1. Create a table partitioned by client_id:
CREATE TABLE test.sr_ice5 (
    client_id string not null DEFAULT 'unknown',
    item_id string DEFAULT 'unknown',
    ts bigint DEFAULT 1,
    itemtype string DEFAULT 'unknown',
    labels string,
    has_z_info string,
    z_id string
)
PARTITION BY (client_id)
PROPERTIES ("enable_persistent_index" = "true");

  1. Insert data into test.sr_ice5, which includes rows with client_id values both with and without hyphens (e.g., “fruit-tree” and “fruittree”).
  2. Observe the error when inserting rows with a hyphenated client_id:

Error: The row create partition failed since OK. Row: ['fruittree', 'xxxx', yyy, 'zzz']

4.Checking partitions using SHOW PARTITIONS reveals that the partition name for “fruit-tree” appears without the hyphen.

Expected Behavior: Partitions are created accurately reflecting the hyphenated and non-hyphenated client_id values, without omitting hyphens from partition names.
Two partitions should be created:

  • one with name pfruittree with corresponding List =((‘fruittree’))
  • and another one with name pfruit-tree with corresponding List =((‘fruit-tree’))

Real Behavior: The system seems to omit hyphens from partition names, leading to errors when inserting data rows that correspond to the hyphenated client_id values. The insert into statement was not successful.
A workaround by excluding rows with the problematic client_id values (e.g., WHERE client_id != 'fruit-tree' ) allowed the insert operation to succeed, further suggesting the issue is related to how hyphenated values are handled in partition names.

Before posting, I searched the forum and the documentation but couldn’t find specific mentions of this behavior or recommended practices for handling such cases.

Has anyone else experienced this issue with hyphenated values in partition names, or does anyone have insights on how to address this problem? Any guidance or suggestions would be greatly appreciated.

Thank you!

I don’t think we’ve covered that use case. Can you create a github issue and post the link to this thread? Thanks!

To reproduce:

CREATE TABLE test.sr_icetest (
client_id STRING NOT NULL DEFAULT ‘unknown’,
item_id STRING DEFAULT ‘unknown’,
ts BIGINT DEFAULT “1”,
itemtype STRING DEFAULT ‘unknown’,
labels STRING,
has_z_info STRING,
z_id STRING
) PARTITION BY (client_id)
PROPERTIES (
“enable_persistent_index” = “true”
);

INSERT INTO test.sr_icetest (client_id, item_id, ts, itemtype, labels, has_z_info, z_id)
VALUES (‘fruit-tree’, ‘001’, 1622548800, ‘typeA’, ‘label1’, ‘yes’, ‘z001’);

INSERT INTO test.sr_icetest (client_id, item_id, ts, itemtype, labels, has_z_info, z_id)
VALUES (‘fruittree’, ‘002’, 1622635200, ‘typeB’, ‘label2’, ‘no’, ‘z002’);