mustafasrepo opened a new issue, #5586:
URL: https://github.com/apache/arrow-datafusion/issues/5586

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   <!--
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for 
this feature, in addition to  the *what*)
   -->
   When I run the query below
   ```sql
   SELECT
       SUM(c6) OVER(ORDER BY c2 GROUPS BETWEEN 1 PRECEDING AND 1 FOLLOWING) as 
sum1
       FROM aggregate_test_100
   ```
   It produces following plan
   ```sql
   "ProjectionExec: expr=[SUM(aggregate_test_100.c6) ORDER BY 
[aggregate_test_100.c2 ASC NULLS LAST] GROUPS BETWEEN 1 PRECEDING AND 1 
FOLLOWING@13 as sum1]",
   "  WindowAggExec: wdw=[SUM(aggregate_test_100.c6): Ok(Field { name: 
\"SUM(aggregate_test_100.c6)\", data_type: Int64, nullable: true, dict_id: 0, 
dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Groups, 
start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(1)) }]",
   "    SortExec: expr=[c2@1 ASC NULLS LAST]",
   "      CsvExec: files={1 group: [[file_path]]}, has_header=true, limit=None, 
projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13]",
   ```
   theoretically, this query can run using `BoundedWindowAggExec` which enables 
us to not break pipeline. Add support for `GROUPS` in the 
`BoundedWindowAggExec`.
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   I would like above query to generate following plan
   ```sql
   "ProjectionExec: expr=[SUM(aggregate_test_100.c6) ORDER BY 
[aggregate_test_100.c2 ASC NULLS LAST] GROUPS BETWEEN 1 PRECEDING AND 1 
FOLLOWING@13 as sum1]",
   "  BoundedWindowAggExec: wdw=[SUM(aggregate_test_100.c6): Ok(Field { name: 
\"SUM(aggregate_test_100.c6)\", data_type: Int64, nullable: true, dict_id: 0, 
dict_is_ordered: false, metadata: {} }), frame: WindowFrame { units: Groups, 
start_bound: Preceding(UInt64(1)), end_bound: Following(UInt64(1)) }]",
   "    SortExec: expr=[c2@1 ASC NULLS LAST]",
   "      CsvExec: files={1 group: [[file_path]]}, has_header=true, limit=None, 
projection=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13]",
   ```
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features 
you've considered.
   -->
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   


-- 
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]

Reply via email to