You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "philo-he (via GitHub)" <gi...@apache.org> on 2026/06/16 22:51:31 UTC
[PR] [VL] Enable offloading lead, lag and nth_value with constant input [gluten]
philo-he opened a new pull request, #12308:
URL: https://github.com/apache/gluten/pull/12308
<!--
Thank you for submitting a pull request! Here are some tips:
1. For first-time contributors, please read our contributing guide:
https://github.com/apache/gluten/blob/main/CONTRIBUTING.md
2. If necessary, create a GitHub issue for discussion beforehand to avoid duplicate work.
3. If the PR is specific to a single backend, include [VL] or [CH] in the PR title to indicate the
Velox or ClickHouse backend, respectively.
4. If the PR is not ready for review, please mark it as a draft.
-->
## What changes are proposed in this pull request?
This is already one Velox PR supports constant inputs for them.
<!--
Provide a clear and concise description of the changes introduced in this PR.
Ensure the PR description aligns with the code changes, especially after updates.
If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the corresponding issue
when the PR is merged.
-->
## How was this patch tested?
New tests are added.
<!--
Describe how the changes were tested, if applicable.
Include new tests to validate the functionality, if necessary.
For UI-related changes, attach screenshots to demonstrate the updates.
-->
## Was this patch authored or co-authored using generative AI tooling?
No.
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support lead, lag and nth_value offloading with constant input [gluten]
Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 commented on code in PR #12308:
URL: https://github.com/apache/gluten/pull/12308#discussion_r3424953197
##########
backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala:
##########
@@ -514,7 +514,7 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa
runQueryAndCompare(
"select l_suppkey, l_orderkey, nth_value(1, 2) over" +
" (partition by l_suppkey order by l_orderkey) from lineitem ") {
- checkSparkPlan[WindowExec]
+ checkSparkPlan[WindowExecTransformer]
}
Review Comment:
I think we can remove this test, because it duplicates the test added in WindowFunctionsValidateSuite.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support lead, lag and nth_value offloading with constant input [gluten]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12308:
URL: https://github.com/apache/gluten/pull/12308#discussion_r3424495053
##########
backends-velox/src/test/scala/org/apache/gluten/functions/WindowFunctionsValidateSuite.scala:
##########
@@ -34,4 +34,23 @@ class WindowFunctionsValidateSuite extends FunctionsValidateSuite {
}
}
+ test("lag/lead, nth_value window function with constant input") {
+ runQueryAndCompare(
+ "select lag(10, -2) over" +
+ " (partition by l_suppkey order by l_orderkey) from lineitem") {
+ checkGlutenPlan[WindowExecTransformer]
+ }
+
+ runQueryAndCompare(
+ "select lead(10, -2) over" +
Review Comment:
Same as the lag case above: this “constant input” test currently re-tests the negative offset path. Switching to a positive offset makes the intent clearer and reduces redundancy.
##########
backends-velox/src/test/scala/org/apache/gluten/functions/WindowFunctionsValidateSuite.scala:
##########
@@ -34,4 +34,23 @@ class WindowFunctionsValidateSuite extends FunctionsValidateSuite {
}
}
+ test("lag/lead, nth_value window function with constant input") {
+ runQueryAndCompare(
+ "select lag(10, -2) over" +
Review Comment:
This test is intended to validate constant *input* support, but it reuses the negative offset (-2) scenario already covered by the previous test. Using a positive offset here keeps the test focused and avoids coupling it to the separate “negative offset” behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support lead, lag and nth_value offloading with constant input [gluten]
Posted by "philo-he (via GitHub)" <gi...@apache.org>.
philo-he merged PR #12308:
URL: https://github.com/apache/gluten/pull/12308
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support lead, lag and nth_value offloading with constant input [gluten]
Posted by "philo-he (via GitHub)" <gi...@apache.org>.
philo-he commented on code in PR #12308:
URL: https://github.com/apache/gluten/pull/12308#discussion_r3425351736
##########
backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala:
##########
@@ -514,7 +514,7 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa
runQueryAndCompare(
"select l_suppkey, l_orderkey, nth_value(1, 2) over" +
" (partition by l_suppkey order by l_orderkey) from lineitem ") {
- checkSparkPlan[WindowExec]
+ checkSparkPlan[WindowExecTransformer]
}
Review Comment:
@zml1206, thanks for the comment. I have just removed it. Could you take a look again?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Support lead, lag and nth_value offloading with constant input [gluten]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12308:
URL: https://github.com/apache/gluten/pull/12308#discussion_r3424824629
##########
backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala:
##########
@@ -514,7 +514,7 @@ class MiscOperatorSuite extends VeloxWholeStageTransformerSuite with AdaptiveSpa
runQueryAndCompare(
"select l_suppkey, l_orderkey, nth_value(1, 2) over" +
" (partition by l_suppkey order by l_orderkey) from lineitem ") {
- checkSparkPlan[WindowExec]
+ checkSparkPlan[WindowExecTransformer]
Review Comment:
The comment above this assertion is now inaccurate: this test expects `nth_value` with a foldable (constant) input to be offloaded to `WindowExecTransformer`, so it is supported rather than unsupported. Please update/remove the stale comment to avoid confusion when diagnosing window offload behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org