googleapis / python-bigquery-sqlalchemy

SQLAlchemy dialect for BigQuery
MIT License
426 stars 127 forks source link

Unable to use table sampling #416

Open XiaoyuLiu198 opened 2 years ago

XiaoyuLiu198 commented 2 years ago

BigQuery don't support sampling with order function in sqlalchemy. By sampling I mean raw SQL looks like this SELECT * FROM dataset.my_table TABLESAMPLE SYSTEM (10 PERCENT).

Describe the solution you'd like Wondering if it's possible that sampling function can be added. Describe alternatives you've considered If RAND() is supported in sqlalchemy, we then can get shuffled sample together with select(with where condition). Additional context Add any other context or screenshots about the feature request here.

meredithslota commented 1 year ago

This is a feature request for BigQuery itself — I believe that table sampling is in "preview" now: https://cloud.google.com/bigquery/docs/table-sampling.