diff --git a/backends-velox/src/test/scala/io/glutenproject/execution/VeloxFunctionsValidateSuite.scala b/backends-velox/src/test/scala/io/glutenproject/execution/VeloxFunctionsValidateSuite.scala index 4cffa121dae3..e5bee97611a2 100644 --- a/backends-velox/src/test/scala/io/glutenproject/execution/VeloxFunctionsValidateSuite.scala +++ b/backends-velox/src/test/scala/io/glutenproject/execution/VeloxFunctionsValidateSuite.scala @@ -524,4 +524,18 @@ class VeloxFunctionsValidateSuite extends VeloxWholeStageTransformerSuite { } } + test("lag/lead window function with negative input offset") { + runQueryAndCompare( + "select lag(l_orderkey, -2) over" + + " (partition by l_suppkey order by l_orderkey) from lineitem ") { + checkOperatorMatch[WindowExecTransformer] + } + + runQueryAndCompare( + "select lead(l_orderkey, -2) over" + + " (partition by l_suppkey order by l_orderkey) from lineitem ") { + checkOperatorMatch[WindowExecTransformer] + } + } + }