mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Add support for TABLESAMPLE pipe operator (#1860)
This commit is contained in:
parent
eacf00d269
commit
a8bde39efb
3 changed files with 29 additions and 5 deletions
|
|
@ -15156,6 +15156,11 @@ fn parse_pipeline_operator() {
|
|||
dialects.verified_stmt("SELECT * FROM users |> ORDER BY id DESC");
|
||||
dialects.verified_stmt("SELECT * FROM users |> ORDER BY id DESC, name ASC");
|
||||
|
||||
// tablesample pipe operator
|
||||
dialects.verified_stmt("SELECT * FROM tbl |> TABLESAMPLE BERNOULLI (50)");
|
||||
dialects.verified_stmt("SELECT * FROM tbl |> TABLESAMPLE SYSTEM (50 PERCENT)");
|
||||
dialects.verified_stmt("SELECT * FROM tbl |> TABLESAMPLE SYSTEM (50) REPEATABLE (10)");
|
||||
|
||||
// many pipes
|
||||
dialects.verified_stmt(
|
||||
"SELECT * FROM CustomerOrders |> AGGREGATE SUM(cost) AS total_cost GROUP BY customer_id, state, item_type |> EXTEND COUNT(*) OVER (PARTITION BY customer_id) AS num_orders |> WHERE num_orders > 1 |> AGGREGATE AVG(total_cost) AS average GROUP BY state DESC, item_type ASC",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue