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

   
   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   `RANGE` with offset `PRECEDING/FOLLOWING` requires exactly one `ORDER BY` 
column. However, when we enter `UNBOUNDED` offset to both sides, It should 
accept multiple ORDER BY columns. When I run the query below  using datafusion,
   
   ```sql
   SELECT
     SUM(c2) OVER(ORDER BY c5, c6 RANGE BETWEEN UNBOUNDED PRECEDING AND 
UNBOUNDED FOLLOWING) as summ
   FROM aggregate_test_100
   ```
   
   the planner gives the error below. 
   
   ```rust
   Error: Plan("With window frame of type RANGE, the order by expression must 
be of length 1, got 2")
   ```
   
   **Describe the solution you'd like**
   
   Add additional check for whether `WindowFrameBound` fields `Preceding` and 
`Following` are `None` before giving error above
   
   **Describe alternatives you've considered**
   
   N.A
   
   **Additional context**
   
   relevant code section can be found here 
   
   [arrow-datafusion/planner.rs at c3bf84e334d6a12c89bacec38e2baa02ca2417ac ยท 
apache/arrow-datafusion](https://github.com/apache/arrow-datafusion/blob/c3bf84e334d6a12c89bacec38e2baa02ca2417ac/datafusion/sql/src/planner.rs#L2143)
   


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