This is an automated email from the ASF dual-hosted git repository.
richox pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/auron.git
The following commit(s) were added to refs/heads/master by this push:
new f37037d2 [AURON #1969] Disable auron.udf.singleChildFallback.enabled
in unit tests (#1970)
f37037d2 is described below
commit f37037d2918addcedc4a78860453e44ecc78107f
Author: yew1eb <[email protected]>
AuthorDate: Mon Feb 2 10:53:52 2026 +0800
[AURON #1969] Disable auron.udf.singleChildFallback.enabled in unit tests
(#1970)
<!--
- Start the PR title with the related issue ID, e.g. '[AURON #XXXX]
Short summary...'.
-->
# Which issue does this PR close?
Closes #1969
# Rationale for this change
The single-child fallback optimization is now configurable via
auron.udf.singleChildFallback.enabled (default: true). It hides the
actual fallback status of expressions/UDFs in unit tests, which is not
conducive to validating real behavior and debugging.
# What changes are included in this PR?
# Are there any user-facing changes?
# How was this patch tested?
---
.../org/apache/auron/AuronFunctionSuite.scala | 10 ++++---
.../scala/org/apache/auron/AuronQuerySuite.scala | 34 +++++++++++++---------
.../scala/org/apache/auron/BaseAuronSQLSuite.scala | 1 +
3 files changed, 27 insertions(+), 18 deletions(-)
diff --git
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
index 0a4c1203..06e564a9 100644
---
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
+++
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
@@ -128,10 +128,12 @@ class AuronFunctionSuite extends AuronQueryTest with
BaseAuronSQLSuite {
}
test("regexp_extract function with UDF failback") {
- withTable("t1") {
- sql("create table t1(c1 string) using parquet")
- sql("insert into t1 values('Auron Spark SQL')")
- checkSparkAnswerAndOperator("select regexp_extract(c1, '^A(.*)L$', 1)
from t1")
+ withSQLConf("spark.auron.udf.singleChildFallback.enabled" -> "true") {
+ withTable("t1") {
+ sql("create table t1(c1 string) using parquet")
+ sql("insert into t1 values('Auron Spark SQL')")
+ checkSparkAnswerAndOperator("select regexp_extract(c1, '^A(.*)L$', 1)
from t1")
+ }
}
}
diff --git
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala
index e82eb78f..40eecda4 100644
---
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala
+++
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala
@@ -42,21 +42,25 @@ class AuronQuerySuite extends AuronQueryTest with
BaseAuronSQLSuite with AuronSQ
}
test("test filter with year function") {
- withTable("t1") {
- sql("create table t1 using parquet as select '2024-12-18' as event_time")
- checkSparkAnswerAndOperator(s"""
- |select year, count(*)
- |from (select event_time, year(event_time) as year from t1) t
- |where year <= 2024
- |group by year
- |""".stripMargin)
+ withSQLConf("spark.auron.udf.singleChildFallback.enabled" -> "true") {
+ withTable("t1") {
+ sql("create table t1 using parquet as select '2024-12-18' as
event_time")
+ checkSparkAnswerAndOperator(s"""
+ |select year, count(*)
+ |from (select event_time, year(event_time) as year from t1) t
+ |where year <= 2024
+ |group by year
+ |""".stripMargin)
+ }
}
}
test("test select multiple spark ext functions with the same signature") {
- withTable("t1") {
- sql("create table t1 using parquet as select '2024-12-18' as event_time")
- checkSparkAnswerAndOperator("select year(event_time), month(event_time)
from t1")
+ withSQLConf("spark.auron.udf.singleChildFallback.enabled" -> "true") {
+ withTable("t1") {
+ sql("create table t1 using parquet as select '2024-12-18' as
event_time")
+ checkSparkAnswerAndOperator("select year(event_time),
month(event_time) from t1")
+ }
}
}
@@ -171,9 +175,11 @@ class AuronQuerySuite extends AuronQueryTest with
BaseAuronSQLSuite with AuronSQ
}
test("floor function with long input") {
- withTable("t1") {
- sql("create table t1 using parquet as select 1L as c1, 2.2 as c2")
- checkSparkAnswerAndOperator("select floor(c1), floor(c2) from t1")
+ withSQLConf("spark.auron.udf.singleChildFallback.enabled" -> "true") {
+ withTable("t1") {
+ sql("create table t1 using parquet as select 1L as c1, 2.2 as c2")
+ checkSparkAnswerAndOperator("select floor(c1), floor(c2) from t1")
+ }
}
}
diff --git
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/BaseAuronSQLSuite.scala
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/BaseAuronSQLSuite.scala
index a8a9c259..cd3ce975 100644
---
a/spark-extension-shims-spark/src/test/scala/org/apache/auron/BaseAuronSQLSuite.scala
+++
b/spark-extension-shims-spark/src/test/scala/org/apache/auron/BaseAuronSQLSuite.scala
@@ -60,6 +60,7 @@ trait BaseAuronSQLSuite extends SharedSparkSession {
.set("spark.auron.enable", "true")
.set("spark.ui.enabled", "false")
.set("spark.sql.warehouse.dir", warehouseDir)
+ .set("spark.auron.udf.singleChildFallback.enabled", "false")
if (SparkVersionUtil.isSparkV40OrGreater) {
// Spark 4.0+: Disable session artifact isolation, align with Spark 3.x
behavior