Skip to content

Commit

Permalink
allow different stability plans for 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Jun 18, 2024
1 parent 9a66671 commit 76a331f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ under the License.
<additional.pre35.test.source>spark-pre-3.5</additional.pre35.test.source>
<shims.majorVerSrc>spark-3.x</shims.majorVerSrc>
<shims.minorVerSrc>spark-3.4</shims.minorVerSrc>
<shims.pre35Src>spark-pre-3.5</shims.pre35Src>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 76a331f

Please sign in to comment.