Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.9.0
-
None
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.