moshap-firebolt opened a new pull request, #2404:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2404
GoogleSQL allows an aggregate call to carry an inline `WHERE` filter, e.g.
`COUNT(* WHERE cond)`, `SUM(x WHERE cond)`, `ARRAY_AGG(x WHERE cond ORDER BY
y)`.
It is the in-argument spelling of the standard `AGG(expr) FILTER (WHERE
cond)`.
### Changes
- Add `FunctionArgumentClause::Where(Expr)`.
- Parse it in `parse_function_argument_list` for the `BigQuery` and `Generic`
dialects, before `ORDER BY` / `LIMIT` / `HAVING`.
- `Display` renders `WHERE <expr>`; span is computed from the predicate.
- New test `parse_aggregate_with_where_filter` in
`tests/sqlparser_bigquery.rs`.
Docs:
https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions
--
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]