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

support OFFSET values greater than one, for LEAD & LAG window functions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.9.0
    • None
    • Execution - Flow

    Description

      Provide support for OFFSET values greater than one, for LEAD & LAG window functions.

      Adding adeneche comments from the dev list here

      Things that need to be done to make Lag (or Lead) support offsets other
      than 1:
      - WindowFunction.Lead should extract the offset value from its FunctionCall
      argument, you can look at WindowFunctionNtile.numTilesFromExpression() for
      and example on how to do that.
      - make sure calls to copyNext() and copyPrev() in NoFrameSupportTemplate
      use the offset and not the hard coded value (you already figured that out)
      - finally make sure you update UnsupportedOperatorsVisitor to no longer
      throw an exception when we pass an offset value other than 1 to Lead or
      Lag. Just search for DRILL-3596 in that class and you will find the if
      block that need to be removed
      
      I think this should be enough to get it to work in the general case.
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            khfaraaz Khurram Faraaz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: