diff --git a/pom.xml b/pom.xml index 8027b9690..8ca7681aa 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,7 @@ under the License. spark-pre-3.5 spark-3.x spark-3.4 + spark-pre-3.5 diff --git a/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala b/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala index 0136b62a4..8e4e3a5af 100644 --- a/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala +++ b/spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala @@ -1029,6 +1029,10 @@ object CometSparkSessionExtensions extends Logging { org.apache.spark.SPARK_VERSION >= "3.4" } + def isSpark35Plus: Boolean = { + org.apache.spark.SPARK_VERSION >= "3.5" + } + def isSpark40Plus: Boolean = { org.apache.spark.SPARK_VERSION >= "4.0" } diff --git a/spark/src/test/scala/org/apache/spark/sql/comet/CometPlanStabilitySuite.scala b/spark/src/test/scala/org/apache/spark/sql/comet/CometPlanStabilitySuite.scala index 691d2cd63..02e537204 100644 --- a/spark/src/test/scala/org/apache/spark/sql/comet/CometPlanStabilitySuite.scala +++ b/spark/src/test/scala/org/apache/spark/sql/comet/CometPlanStabilitySuite.scala @@ -36,7 +36,7 @@ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.TestSparkSession import org.apache.comet.CometConf -import org.apache.comet.CometSparkSessionExtensions.{isSpark34Plus, isSpark40Plus} +import org.apache.comet.CometSparkSessionExtensions.{isSpark34Plus, isSpark35Plus, isSpark40Plus} /** * Similar to [[org.apache.spark.sql.PlanStabilitySuite]], checks that TPC-DS Comet plans don't @@ -298,8 +298,13 @@ trait CometPlanStabilitySuite extends DisableAdaptiveExecutionSuite with TPCDSBa } class CometTPCDSV1_4_PlanStabilitySuite extends CometPlanStabilitySuite { - private val planName = - if (isSpark40Plus) "approved-plans-v1_4-spark4_0" else "approved-plans-v1_4" + private val planName = if (isSpark40Plus) { + "approved-plans-v1_4-spark4_0" + } else if (isSpark35Plus) { + "approved-plans-v1_4-spark3_5" + } else { + "approved-plans-v1_4" + } override val goldenFilePath: String = new File(baseResourcePath, planName).getAbsolutePath @@ -311,8 +316,13 @@ class CometTPCDSV1_4_PlanStabilitySuite extends CometPlanStabilitySuite { } class CometTPCDSV2_7_PlanStabilitySuite extends CometPlanStabilitySuite { - private val planName = - if (isSpark40Plus) "approved-plans-v2_7-spark4_0" else "approved-plans-v2_7" + private val planName = if (isSpark40Plus) { + "approved-plans-v2_7-spark4_0" + } else if (isSpark35Plus) { + "approved-plans-v2_7-spark3_5" + } else { + "approved-plans-v2_7" + } override val goldenFilePath: String = new File(baseResourcePath, planName).getAbsolutePath