This is an automated email from the ASF dual-hosted git repository.
philo-he pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new dbed462035 [GLUTEN-11916][VL][TEST] Enable exists-orderby-limit.sql on
Spark 4.1 with SPARK-57125 workaround (#13265)
dbed462035 is described below
commit dbed462035299fe8d3d2bcc4e1ce4cefbebaf485
Author: rdtr <[email protected]>
AuthorDate: Tue Oct 13 23:45:30 2026 -0700
[GLUTEN-11916][VL][TEST] Enable exists-orderby-limit.sql on Spark 4.1 with
SPARK-57125 workaround (#13265)
---
.../inputs/subquery/exists-subquery/exists-orderby-limit.sql | 12 ++++++++++++
.../gluten/utils/velox/VeloxSQLQueryTestSettings.scala | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git
a/gluten-ut/spark41/src/test/resources/backends-velox/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql
b/gluten-ut/spark41/src/test/resources/backends-velox/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql
index 9ff3409b21..1b2a884d15 100644
---
a/gluten-ut/spark41/src/test/resources/backends-velox/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql
+++
b/gluten-ut/spark41/src/test/resources/backends-velox/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql
@@ -5,6 +5,18 @@
--CONFIG_DIM1
spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY
--CONFIG_DIM1
spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN
+-- GlutenSQLQueryTestSuite excludes ConvertToLocalRelation, ConstantFolding and
+-- NullPropagation by default to force queries through Gluten's offload paths.
+-- However, EXISTS+OFFSET queries hit Spark's LimitPushDown rule which produces
+-- `LocalLimit(Add(limit, offset), ...)` and assumes ConstantFolding will fold
+-- the Add. Without ConstantFolding the planner fails with
+-- `AssertionError: No plan for LocalLimit (1 + 2)` because BasicOperators only
+-- matches LocalLimit(IntegerLiteral, _). Re-enable ConstantFolding (and
+-- NullPropagation, which the test framework's --SET parser would split on
+-- the comma) for this file by keeping only ConvertToLocalRelation excluded.
+-- Tracked upstream as SPARK-57125.
+--SET
spark.sql.optimizer.excludedRules=org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation
+
--ONLY_IF spark
CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES
(100, "emp 1", date "2005-01-01", 100.00D, 10),
diff --git
a/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxSQLQueryTestSettings.scala
b/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxSQLQueryTestSettings.scala
index 7eef6d245a..5c66529b0e 100644
---
a/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxSQLQueryTestSettings.scala
+++
b/gluten-ut/spark41/src/test/scala/org/apache/gluten/utils/velox/VeloxSQLQueryTestSettings.scala
@@ -127,7 +127,7 @@ object VeloxSQLQueryTestSettings extends
SQLQueryTestSettings {
"subquery/exists-subquery/exists-cte.sql",
"subquery/exists-subquery/exists-having.sql",
"subquery/exists-subquery/exists-joins-and-set-ops.sql",
- // TODO: fix on Spark-4.1
"subquery/exists-subquery/exists-orderby-limit.sql",
+ "subquery/exists-subquery/exists-orderby-limit.sql",
"subquery/exists-subquery/exists-outside-filter.sql",
"subquery/exists-subquery/exists-within-and-or.sql",
"subquery/in-subquery/in-basic.sql",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]