comphead opened a new issue, #23261:
URL: https://github.com/apache/datafusion/issues/23261
### Is your feature request related to a problem or challenge?
## Summary
Support `collect_list` and `collect_set` as window functions in DataFusion.
These are commonly used in Spark and other query engines to collect values
within a window frame and enable use cases such as rolling lists, session
analysis, and sequence-based analytics.
## Example
```sql
SELECT
user_id,
ts,
collect_list(event) OVER (
PARTITION BY user_id
ORDER BY ts
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS events
FROM t;
```
```sql
SELECT
user_id,
ts,
collect_set(event) OVER (
PARTITION BY user_id
ORDER BY ts
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS unique_events
FROM t;
```
## Motivation
Supporting these functions would improve Spark compatibility and align
DataFusion with other query engines that support aggregate window functions,
including DuckDB (`list`), Trino/Presto (`array_agg`), PostgreSQL
(`array_agg`), BigQuery (`ARRAY_AGG`), and Snowflake.
## Acceptance Criteria
- Support `collect_list(...) OVER (...)`
- Support `collect_set(...) OVER (...)`
- Support standard window frames (`ROWS` and `RANGE`) where applicable
- Add SQL and DataFrame tests covering common window specifications
### Describe the solution you'd like
_No response_
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
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]