This is an automated email from the ASF dual-hosted git repository.
philo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
The following commit(s) were added to refs/heads/main by this push:
new d985c5424 [VL] Fix literal bound fallback for window range frame
(#5561)
d985c5424 is described below
commit d985c542467784bff94d4928cb1dc3814f58a5ef
Author: PHILO-HE <[email protected]>
AuthorDate: Sun Apr 28 17:16:18 2024 +0800
[VL] Fix literal bound fallback for window range frame (#5561)
---
.../scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala | 2 +-
.../src/test/scala/org/apache/gluten/execution/TestOperator.scala | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git
a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala
b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala
index 0e23ef8ba..00b67fca7 100644
---
a/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala
+++
b/backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxBackend.scala
@@ -302,7 +302,7 @@ object VeloxBackendSettings extends BackendSettingsApi {
def checkLimitations(swf: SpecifiedWindowFrame, orderSpec:
Seq[SortOrder]): Unit = {
def doCheck(bound: Expression, isUpperBound: Boolean): Unit = {
bound match {
- case _: Literal =>
+ case e if e.foldable =>
throw new GlutenNotSupportException(
"Window frame of type RANGE does" +
" not support constant arguments in velox backend")
diff --git
a/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala
b/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala
index 95e92cffa..a60c853db 100644
---
a/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala
+++
b/backends-velox/src/test/scala/org/apache/gluten/execution/TestOperator.scala
@@ -209,6 +209,13 @@ class TestOperator extends VeloxWholeStageTransformerSuite
{
checkSparkOperatorMatch[WindowExec]
}
+ runQueryAndCompare(
+ "select max(l_partkey) over" +
+ " (partition by l_suppkey order by l_orderkey" +
+ " RANGE BETWEEN 6 PRECEDING AND CURRENT ROW) from lineitem ") {
+ checkSparkOperatorMatch[WindowExec]
+ }
+
runQueryAndCompare(
"select ntile(4) over" +
" (partition by l_suppkey order by l_orderkey) from lineitem ") {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]