seve-martinez opened a new pull request, #1566:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1566
Snowflake, Databricks, Postgres, and others all support some from of table
sampling.
This commonly takes on the form
```sql
SELECT ...
FROM ...
{ SAMPLE | TABLESAMPLE } [ samplingMethod ]
```
where
```console
samplingMethod ::= { { BERNOULLI | ROW } ( { <probability> | <num> ROWS } ) |
{ SYSTEM | BLOCK } ( <probability> ) [ { REPEATABLE |
SEED } ( <seed> ) ] }
```
Different dialects support one, the other, or both sample keywords and only
some of the methods. The current PR follows the snowflake paradigm.
## Outstanding questions
- [ ] This method is not currently called anywhere. Review of the `Parser`
code would make me think it should be part of the `parse_table_factor()` logic
since it always trails a relation. However this would then require each variant
of `TableFactor` that supports `SAMPLE` to have a placeholder for it. Is that
the right approach?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]