Cannot distribute a partition-to-be table if it has data and a long name
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
### Steps to reproduce:
```SQL
CREATE TABLE parent (
event_id serial NOT NULL,
event_time timestamptz NOT NULL DEFAULT now())
PARTITION BY RANGE (event_time);
SELECT create_distributed_table('parent', 'event_id');
CREATE TABLE non_distributed_child_with_very_very_very_loooooooong_table_name (
event_id int NOT NULL,
event_time timestamptz NOT NULL DEFAULT now());
INSERT INTO non_distributed_child_with_very_very_very_loooooooong_table_name
SELECT i, '2021-06-15' FROM generate_series(0, 10)i;
ALTER TABLE parent ATTACH PARTITION non_distributed_child_with_very_very_very_loooooooong_table_name
FOR VALUES FROM ('2021-06-01') TO ('2021-07-30');
```
### The error hit is:
```
ERROR: cannot distribute "non_distributed_child_with_very_very_very_loooooooong_table_nam" in sequential mode
because it is not empty
HINT: If you have manually set citus.multi_shard_modify_mode to 'sequential', try with 'parallel' option.
If that is not the case, try distributing local tables when they are empty.
```
@onderkalaci has some further comments on this https://github.com/citusdata/citus/pull/5191#pullrequestreview-742328129
> I guess it is related to #3895 where create_distributed_table internally forces parallel execution. Still, with #3841, we should probably be fine to remove forcing to use parallelization and/or the sequential execution checks.
Contributor guide
Assessment
This issue has not been assessed yet.