Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TABLESAMPLE clause in a columnstore table #28

Open
ktny opened this issue Nov 12, 2024 · 2 comments
Open

Support TABLESAMPLE clause in a columnstore table #28

ktny opened this issue Nov 12, 2024 · 2 comments

Comments

@ktny
Copy link

ktny commented Nov 12, 2024

What feature are you requesting?

create table t1 (num int) using columnstore;
insert into t1 select i from generate_series(1, 10000) s(i);
select * from t1 tablesample system(10);

ERROR:  (PGDuckDB/CreatePlan) Prepared query returned an error: 'Parser Error: Sample method System cannot be used with a discrete sample count, either switch to reservoir sampling or use a sample_size

Why are you requesting this feature?

The TABLESAMPLE clause is useful for sampling from large tables, and I often use it.

What is your proposed implementation for this feature?

No response

@ktny ktny added the feature label Nov 12, 2024
@dpxcc
Copy link
Contributor

dpxcc commented Nov 12, 2024

Thanks for the feature request!
The issue arises from syntax differences in TABLESAMPLE clause between Postgres and DuckDB: https://duckdb.org/docs/sql/samples.html
We could potentially modify pgduckdb_get_querydef() to bridge the syntax differences

@dpxcc
Copy link
Contributor

dpxcc commented Nov 12, 2024

Filed a feature request upstream: duckdb/pg_duckdb#429

@dpxcc dpxcc added this to the tbd milestone Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants