Skip to content

Commit 36a3b8f

Browse files
authored
[GLUTEN-11088][VL] Fix NativeBenchmarkPlanGenerator (#11144)
1 parent 7d8b9b6 commit 36a3b8f

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.github/workflows/velox_backend_x86.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ jobs:
12571257
cd ./cpp/build && ctest -V
12581258
- name: Run CPP benchmark test
12591259
run: |
1260-
$MVN_CMD test -Pspark-3.5 -Pbackends-velox -pl backends-velox -am \
1260+
$MVN_CMD clean test -Pspark-3.5 -Pbackends-velox -pl backends-velox -am \
12611261
-DtagsToInclude="org.apache.gluten.tags.GenerateExample" -Dtest=none -DfailIfNoTests=false -Dexec.skip
12621262
# This test depends on files generated by the above mvn test.
12631263
./cpp/build/velox/benchmarks/generic_benchmark --with-shuffle --partitioning hash --threads 1 --iterations 1 \
@@ -1266,14 +1266,27 @@ jobs:
12661266
--data $(realpath backends-velox/generated-native-benchmark/data_12_0_*_0.parquet),$(realpath backends-velox/generated-native-benchmark/data_12_0_*_1.parquet)
12671267
- name: Run UDF test
12681268
run: |
1269-
# Depends on --build_example=ON.
12701269
yum install -y java-17-openjdk-devel
12711270
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
12721271
export PATH=$JAVA_HOME/bin:$PATH
12731272
java -version
1273+
# Depends on --build_example=ON.
12741274
$MVN_CMD test -Pspark-3.5 -Pbackends-velox -Pjava-17 -Piceberg -Pdelta -Ppaimon -DtagsToExclude=org.apache.gluten.tags.EnhancedFeaturesTest \
12751275
-DtagsToInclude=org.apache.gluten.tags.UDFTest \
12761276
-DargLine="-Dspark.test.home=/opt/shims/spark35/spark_home/"
1277+
- name: Run CPP benchmark test for Spark 4.0
1278+
run: |
1279+
export SPARK_SCALA_VERSION=2.13
1280+
yum install -y java-17-openjdk-devel
1281+
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
1282+
export PATH=$JAVA_HOME/bin:$PATH
1283+
$MVN_CMD clean test -Pspark-4.0 -Pjava-17 -Pscala-2.13 -Pbackends-velox -pl backends-velox -am \
1284+
-DtagsToInclude="org.apache.gluten.tags.GenerateExample" -Dtest=none -DfailIfNoTests=false -Dexec.skip
1285+
# This test depends on files generated by the above mvn test.
1286+
./cpp/build/velox/benchmarks/generic_benchmark --with-shuffle --partitioning hash --threads 1 --iterations 1 \
1287+
--conf $(realpath backends-velox/generated-native-benchmark/conf_12_0_*.ini) \
1288+
--plan $(realpath backends-velox/generated-native-benchmark/plan_12_0_*.json) \
1289+
--data $(realpath backends-velox/generated-native-benchmark/data_12_0_*_0.parquet),$(realpath backends-velox/generated-native-benchmark/data_12_0_*_1.parquet)
12771290
- name: Upload test report
12781291
uses: actions/upload-artifact@v4
12791292
with:

backends-velox/src/test/scala/org/apache/gluten/benchmarks/NativeBenchmarkPlanGenerator.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ class NativeBenchmarkPlanGenerator extends VeloxWholeStageTransformerSuite {
7171
}
7272
}
7373

74-
// TODO: fix on spark-4.0
75-
testWithMaxSparkVersion("Test plan json non-empty - AQE on", "3.5") {
74+
test("Test plan json non-empty - AQE on") {
7675
withSQLConf(
7776
SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true",
7877
GlutenConfig.CACHE_WHOLE_STAGE_TRANSFORMER_CONTEXT.key -> "true") {
@@ -85,7 +84,7 @@ class NativeBenchmarkPlanGenerator extends VeloxWholeStageTransformerSuite {
8584
executedPlan.execute()
8685

8786
val finalPlan = executedPlan.asInstanceOf[AdaptiveSparkPlanExec].executedPlan
88-
val lastStageTransformer = finalPlan.find(_.isInstanceOf[WholeStageTransformer])
87+
val lastStageTransformer = stripAQEPlan(finalPlan).find(_.isInstanceOf[WholeStageTransformer])
8988
assert(lastStageTransformer.nonEmpty)
9089
val planJson = lastStageTransformer.get.asInstanceOf[WholeStageTransformer].substraitPlanJson
9190
assert(planJson.nonEmpty)

0 commit comments

Comments
 (0)