From 84f9d7d145b49da552db1069ed4f91ef3155b61a Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Wed, 20 Mar 2024 10:20:25 +0800 Subject: [PATCH] Add a test --- .../execution/VeloxFunctionsValidateSuite.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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] + } + } + }