Khurram Faraaz created DRILL-5099: ------------------------------------- Summary: support OFFSET values greater than one, for LEAD & LAG window functions Key: DRILL-5099 URL: https://issues.apache.org/jira/browse/DRILL-5099 Project: Apache Drill Issue Type: Bug Components: Execution - Flow Affects Versions: 1.9.0 Reporter: Khurram Faraaz Priority: Minor
Provide support for OFFSET values greater than one, for LEAD & LAG window functions. Adding [~adeneche] comments from the dev list here {noformat} 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. {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)