-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
Implement the FILTER clause for aggregate functions (introduced in SQL:2003). This syntax allows for filtering before aggregation.
SUM(<expression>) FILTER(WHERE <condition>)Describe the solution you'd like
Have the filter support directly in our AggregateExec.
Describe alternatives you've considered
Rewrite the filter clause for aggregate functions to use the CASE WHEN expression during planning. However, null handling for each aggregator function regarding the filter would be error-prone.
Additional context
PostgreSQL: https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-AGGREGATES
Spark: https://spark.apache.org/docs/3.3.2/sql-ref-syntax-qry-select-groupby.html
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request