somu-imply opened a new issue, #15739:
URL: https://github.com/apache/druid/issues/15739

   At this moment, a query like 
   ```
   WITH virtual_table as (select ("customers_city(orders)") as 
vsum_dim1,sum("shipping_cost(orders)") as mes_col
   from us_ecom_orders_com101 group by 1 order by mes_col DESC)
   select vsum_dim1,mes_col,sum(mes_col) OVER (order by vsum_dim1 rows between 
2 PRECEDING and 3 FOLLOWING) as mes_sum
   from virtual_table order by 1
   ```
   AND
   ```
   WITH virtual_table as (select ("customers_city(orders)") as 
vsum_dim1,sum("shipping_cost(orders)") as mes_col
   from us_ecom_orders_com101 group by 1 order by mes_col DESC)
   select vsum_dim1,mes_col,sum(mes_col) OVER (order by vsum_dim1 rows between 
2 FOLLOWING and 3 FOLLOWING) as mes_sum
   from virtual_table order by 1
   ```
   
   are planned identically with the native query showing the same offset in the 
processor for both
   ```
   "processor": {
               "type": "framedAgg",
               "frame": {
                 "peerType": "ROWS",
                 "lowUnbounded": false,
                 "lowOffset": 2,
                 "uppUnbounded": false,
                 "uppOffset": 3,
                 "orderBy": null
               },
   ```
   
   Going forward we need to demarcate these cases and make sure we support 
negative offsets in such a case. At the moment even in native you cannot specify
   ```
   "processor": {
               "type": "framedAgg",
               "frame": {
                 "peerType": "ROWS",
                 "lowUnbounded": false,
                 "lowOffset": -2,
                 "uppUnbounded": false,
                 "uppOffset": 3,
                 "orderBy": null
               },
               "aggregations": [
                 {
                   "type": "longSum",
                   "name": "w0",
                   "fieldName": "a0"
                 }
               ]
             }
   ```
   which throws an IndexOutOfBounds exception


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

Reply via email to