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 5c6def05e88ec..3c2218146458f 100644 --- a/backends-velox/src/test/scala/io/glutenproject/execution/VeloxFunctionsValidateSuite.scala +++ b/backends-velox/src/test/scala/io/glutenproject/execution/VeloxFunctionsValidateSuite.scala @@ -512,4 +512,19 @@ 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] + } + } + }