apache / druid

Apache Druid: a high performance real-time analytics database.
https://druid.apache.org/
Apache License 2.0
13.51k stars 3.7k forks source link

Offset based window range support #15767

Open kgyrtkirk opened 9 months ago

kgyrtkirk commented 9 months ago

Description

Please describe the feature or change with as much detail as possible.

Current groups implementation is only correct for sure when its true for the endpoints that they are the current row or they are unbounded.

Extending the support the also allow offset based ranges could enable to process frames like:

ORDER BY time RANGE BETWEEN INTERVAL 1 HOURS PRECEDING AND CURRENT ROW

Motivation

Please provide the following for the desired feature or change:

kgyrtkirk commented 9 months ago

at least 1 test which should pass after this is done:

type: "operatorValidation"

sql: |
  SELECT
    m1,
    FLOOR(m1/3),
    -- these must match as m1 will be 10/20..etc  https://github.com/apache/druid/issues/15767
    m1 = SUM(m1) OVER (ORDER BY FLOOR(m1*10) RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING)  
  FROM foo

expectedResults:
  - [1.0,0.0,true]
  - [2.0,0.0,true]
  - [3.0,1.0,true]
  - [4.0,1.0,true]
  - [5.0,1.0,true]
  - [6.0,2.0,true]
github-actions[bot] commented 2 weeks ago

This issue has been marked as stale due to 280 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions.