From 171b7a420e45baa6ff4709482eaaa3946f8e2f7a Mon Sep 17 00:00:00 2001 From: zhaokuo Date: Mon, 9 Sep 2024 20:04:37 +0800 Subject: [PATCH] add ut --- .../execution/WindowFunctionsValidateSuite.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backends-velox/src/test/scala/org/apache/gluten/execution/WindowFunctionsValidateSuite.scala b/backends-velox/src/test/scala/org/apache/gluten/execution/WindowFunctionsValidateSuite.scala index 04d0d2c56b94..b0f38c74fe0b 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/execution/WindowFunctionsValidateSuite.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/execution/WindowFunctionsValidateSuite.scala @@ -19,6 +19,18 @@ package org.apache.gluten.execution class WindowFunctionsValidateSuite extends FunctionsValidateSuite { test("lag/lead window function with negative input offset") { + runQueryAndCompare( + "select l_suppkey,lag(l_orderkey, -2) over" + + " (partition by l_suppkey order by l_orderkey) from lineitem") { + checkGlutenOperatorMatch[WindowExecTransformer] + } + + runQueryAndCompare( + "select l_suppkey, lead(l_orderkey, -2) over" + + " (partition by l_suppkey order by l_orderkey) from lineitem") { + checkGlutenOperatorMatch[WindowExecTransformer] + } + runQueryAndCompare( "select lag(l_orderkey, -2) over" + " (partition by l_suppkey order by l_orderkey) from lineitem") { @@ -26,7 +38,7 @@ class WindowFunctionsValidateSuite extends FunctionsValidateSuite { } runQueryAndCompare( - "select lead(l_orderkey, -2) over" + + "select lag(l_orderkey, 2) over" + " (partition by l_suppkey order by l_orderkey) from lineitem") { checkGlutenOperatorMatch[WindowExecTransformer] }