gpdb icon indicating copy to clipboard operation
gpdb copied to clipboard

Auto create partition when insert tuples

Open wangpanCN opened this issue 4 years ago • 3 comments

Feature Request

Is your feature request related to a problem? Please describe: I have to make sure all corresponding partitions exist before inserting tuples into a partitioned table, otherwise, an error occurred. It`s inconvenient to do this.

for example: I create a table use following DDL

create table test(a int ,b char) partition by list(a) (partition one values(1));

if I execute SQL like insert into test values(2, 'a'), the error occurs like ERROR: no partition for partitioning key

Describe the feature you'd like to request: Hive can create partition automatically when inserting tuples,can Greenplum provides a similar feature?

wangpanCN avatar Nov 15 '21 08:11 wangpanCN

such feature need to lock catalog for potential DDL operation within the same transaction. it is too heavy and would disallow parallel data loading. I'm afraid it is hard to consider in near future. closing it for now. thanks.

lij55 avatar Aug 02 '22 00:08 lij55

such feature need to lock catalog for potential DDL operation within the same transaction. it is too heavy and would disallow parallel data loading. I'm afraid it is hard to consider in near future. closing it for now. thanks.

I do not think the logic chain lock catalog --> disallow parallel data loading is correct.

I suppose you want to say lock on partitions.

This reminds me of a heavy lock on root partition when doing data expansion for partial tables.

Please keep this open and let R&D spike if having time.

kainwen avatar Aug 02 '22 01:08 kainwen

Suppose following flow: insert into table -> no partition -> creation sub-partition table -> alter parent table in single transaction. I don't think it is possible without locking parent table...

lij55 avatar Aug 02 '22 01:08 lij55