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

Feature Request: Support TABLESAMPLE #558

Open
nbiscaro opened this issue Jan 26, 2025 · 0 comments
Open

Feature Request: Support TABLESAMPLE #558

nbiscaro opened this issue Jan 26, 2025 · 0 comments

Comments

@nbiscaro
Copy link

Discussed in #429

Originally posted by dpxcc November 12, 2024
The TABLESAMPLE clause is useful for sampling from large tables, but pg_duckdb doesn't support it right now due to syntax differences in TABLESAMPLE clause between Postgres and DuckDB: https://duckdb.org/docs/sql/samples.html

SET duckdb.force_execution = ON;
CREATE TABLE t (a int);
SELECT * FROM t TABLESAMPLE SYSTEM (10);

throws

WARNING:  (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
 a 
---
(0 rows)

but it could be an error if we added some DuckDB-only function to the query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant