Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7404

window function RANGE with compound ORDER BY

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.16.0
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None

      Description

      When creating a ticket CALCITE-3402 (to ask for improve the window functions), it's appears that the documentation of drill seems not up to date

      https://drill.apache.org/docs/aggregate-window-functions/

      frame_clause
      If an ORDER BY clause is used for an aggregate function, an explicit frame clause is required. The frame clause refines the set of rows in a function's window, including or excluding sets of rows within the ordered result. The frame clause consists of the ROWS or RANGE keyword and associated specifiers.
      

       But it's currently (1.16) possible to write ORDER BY clause in window function without specify an explicit RANGE clause.

      In this case, an implicit frame clause is used.

      And normally the default/implicit framing option is RANGE UNBOUNDED PRECEDING, which is the same as {{RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW (and should perhaps also be more explicitly specified) }}

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              benj641 benj
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: