Skip to content

Commit 8a1a154

Browse files
authored
docs: Improve documentation for running stability plan tests (#1469)
1 parent a26b3de commit 8a1a154

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

docs/source/contributor-guide/development.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,32 +92,49 @@ Other options for selecting specific suites are described in the [ScalaTest Mave
9292
## Plan Stability Testing
9393

9494
Comet has a plan stability testing framework that can be used to test the stability of the query plans generated by Comet.
95-
The plan stability testing framework is located in the `spark` module and can be run using the following command:
95+
The plan stability testing framework is located in the `spark` module and can be run using the following commands.
96+
97+
First, Comet needs to be installed for each Spark version to be tested:
98+
99+
```sh
100+
./mvnw install -DskipTests -Pspark-3.4
101+
./mvnw install -DskipTests -Pspark-3.5
102+
# note that Spark 4.0 requires JDK 17 or later
103+
./mvnw install -DskipTests -Pspark-4.0
104+
```
105+
106+
Note that the output files get written to `$SPARK_HOME`.
107+
108+
The tests can be run with:
96109

97110
```sh
111+
export SPARK_HOME=`pwd`
98112
./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV1_4_PlanStabilitySuite" -nsu test
99113
./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV1_4_PlanStabilitySuite" -Pspark-3.5 -nsu test
100114
./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV1_4_PlanStabilitySuite" -Pspark-4.0 -nsu test
101115
```
102116

103117
and
104118
```sh
119+
export SPARK_HOME=`pwd`
105120
./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite" -nsu test
106121
./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite" -Pspark-3.5 -nsu test
107122
./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite" -Pspark-4.0 -nsu test
108123
```
109124

110125
If your pull request changes the query plans generated by Comet, you should regenerate the golden files.
111-
To regenerate the golden files, you can run the following command:
126+
To regenerate the golden files, you can run the following commands.
112127

113128
```sh
129+
export SPARK_HOME=`pwd`
114130
SPARK_GENERATE_GOLDEN_FILES=1 ./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV1_4_PlanStabilitySuite" -nsu test
115131
SPARK_GENERATE_GOLDEN_FILES=1 ./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV1_4_PlanStabilitySuite" -Pspark-3.5 -nsu test
116132
SPARK_GENERATE_GOLDEN_FILES=1 ./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV1_4_PlanStabilitySuite" -Pspark-4.0 -nsu test
117133
```
118134

119135
and
120136
```sh
137+
export SPARK_HOME=`pwd`
121138
SPARK_GENERATE_GOLDEN_FILES=1 ./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite" -nsu test
122139
SPARK_GENERATE_GOLDEN_FILES=1 ./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite" -Pspark-3.5 -nsu test
123140
SPARK_GENERATE_GOLDEN_FILES=1 ./mvnw -pl spark -Dsuites="org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite" -Pspark-4.0 -nsu test

spark/src/test/scala/org/apache/spark/sql/comet/CometPlanStabilitySuite.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ trait CometPlanStabilitySuite extends DisableAdaptiveExecutionSuite with TPCDSBa
268268

269269
// Disable char/varchar read-side handling for better performance.
270270
withSQLConf(
271+
CometConf.COMET_EXPLAIN_FALLBACK_ENABLED.key -> "true",
271272
CometConf.COMET_ENABLED.key -> "true",
272273
CometConf.COMET_NATIVE_SCAN_ENABLED.key -> "true",
273274
CometConf.COMET_EXEC_ENABLED.key -> "true",

0 commit comments

Comments
 (0)