Mooncake-Labs / pg_mooncake

Iceberg/Delta Columnstore Table in Postgres
http://mooncake.dev
MIT License
236 stars 12 forks source link

Support CTAS statement USING columnstore #26

Open ktny opened 1 week ago

ktny commented 1 week ago

What feature are you requesting?

I want to create a columnstore table with a CREATE TABLE AS SELECT statement.

create table t1 (id int, name text);
insert into t1 values (1, 'Alice'), (2, 'Bob');
create table t2 using columnstore as select * from t1;

ERROR:  columnstore_tuple_insert not implemented

CTAS WITH NO_DATA is not a problem.

create table t2 using columnstore as select * from t1 with no data;

Why are you requesting this feature?

Because the CTAS statement is convenient for creating a columnstore table while copying part of a table.

What is your proposed implementation for this feature?

No response

dpxcc commented 1 week ago

Yes, this is on our roadmap Before we support it, you can work around by

create table t2 using columnstore as select * from t1 with no data;
insert into t2 select * from t1;
dpxcc commented 1 week ago

https://github.com/duckdb/pg_duckdb/commit/4a7596cd586be65401f6104523ed1db25ce111ed