Skip to content

Commit d9b4792

Browse files
authored
chore: Enable Spark SQL tests for auto scan mode (#1885)
* enable Spark SQL tests * fix * Revert "fix" This reverts commit 38d6643. * fix 3.5.6 diff * fix 3.4.3 diff * fix 4.0.0-preview1 diff * fix Spark SQL log format * address feedback
1 parent a67008b commit d9b4792

File tree

4 files changed

+36
-20
lines changed

4 files changed

+36
-20
lines changed

.github/workflows/spark_sql_test_native_auto.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
on:
25+
push:
26+
paths-ignore:
27+
- "doc/**"
28+
- "docs/**"
29+
- "**.md"
30+
pull_request:
31+
paths-ignore:
32+
- "doc/**"
33+
- "docs/**"
34+
- "**.md"
2535
# manual trigger
2636
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
2737
workflow_dispatch:
@@ -35,7 +45,7 @@ jobs:
3545
matrix:
3646
os: [ubuntu-24.04]
3747
java-version: [11]
38-
spark-version: [{short: '3.4', full: '3.4.3'}, {short: '3.5', full: '3.5.5'}]
48+
spark-version: [{short: '3.4', full: '3.4.3'}, {short: '3.5', full: '3.5.6'}]
3949
module:
4050
- {name: "catalyst", args1: "catalyst/test", args2: ""}
4151
- {name: "sql/core-1", args1: "", args2: sql/testOnly * -- -l org.apache.spark.tags.ExtendedSQLTest -l org.apache.spark.tags.SlowSQLTest}
@@ -65,7 +75,7 @@ jobs:
6575
run: |
6676
cd apache-spark
6777
rm -rf /root/.m2/repository/org/apache/parquet # somehow parquet cache requires cleanups
68-
ENABLE_COMET=true ENABLE_COMET_SHUFFLE=true COMET_PARQUET_SCAN_IMPL=auto build/sbt ${{ matrix.module.args1 }} "${{ matrix.module.args2 }}"
78+
ENABLE_COMET=true ENABLE_COMET_SHUFFLE=true COMET_PARQUET_SCAN_IMPL=auto build/sbt -Dsbt.log.noformat=true ${{ matrix.module.args1 }} "${{ matrix.module.args2 }}"
6979
env:
7080
LC_ALL: "C.UTF-8"
7181

dev/diffs/3.4.3.diff

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,7 @@ index abe606ad9c1..2d930b64cca 100644
27002700
val tblTargetName = "tbl_target"
27012701
val tblSourceQualified = s"default.$tblSourceName"
27022702
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
2703-
index dd55fcfe42c..cdeef29df48 100644
2703+
index dd55fcfe42c..a1d390c93d0 100644
27042704
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
27052705
+++ b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
27062706
@@ -27,6 +27,7 @@ import scala.concurrent.duration._
@@ -2728,7 +2728,7 @@ index dd55fcfe42c..cdeef29df48 100644
27282728
if (testTags.exists(_.isInstanceOf[DisableAdaptiveExecution])) {
27292729
super.test(testName, testTags: _*) {
27302730
withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") {
2731-
@@ -126,7 +128,26 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
2731+
@@ -126,7 +128,28 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
27322732
}
27332733
}
27342734
} else {
@@ -2737,8 +2737,10 @@ index dd55fcfe42c..cdeef29df48 100644
27372737
+ ignore(testName + " (disabled when Comet is on)", testTags: _*)(testFun)
27382738
+ } else {
27392739
+ val cometScanImpl = CometConf.COMET_NATIVE_SCAN_IMPL.get(conf)
2740-
+ val isNativeIcebergCompat = cometScanImpl == CometConf.SCAN_NATIVE_ICEBERG_COMPAT
2741-
+ val isNativeDataFusion = cometScanImpl == CometConf.SCAN_NATIVE_DATAFUSION
2740+
+ val isNativeIcebergCompat = cometScanImpl == CometConf.SCAN_NATIVE_ICEBERG_COMPAT ||
2741+
+ cometScanImpl == CometConf.SCAN_AUTO
2742+
+ val isNativeDataFusion = cometScanImpl == CometConf.SCAN_NATIVE_DATAFUSION ||
2743+
+ cometScanImpl == CometConf.SCAN_AUTO
27422744
+ if (isCometEnabled && isNativeIcebergCompat &&
27432745
+ testTags.exists(_.isInstanceOf[IgnoreCometNativeIcebergCompat])) {
27442746
+ ignore(testName + " (disabled for NATIVE_ICEBERG_COMPAT)", testTags: _*)(testFun)
@@ -2756,7 +2758,7 @@ index dd55fcfe42c..cdeef29df48 100644
27562758
}
27572759
}
27582760

2759-
@@ -242,6 +263,29 @@ private[sql] trait SQLTestUtilsBase
2761+
@@ -242,6 +265,29 @@ private[sql] trait SQLTestUtilsBase
27602762
protected override def _sqlContext: SQLContext = self.spark.sqlContext
27612763
}
27622764

@@ -2786,7 +2788,7 @@ index dd55fcfe42c..cdeef29df48 100644
27862788
protected override def withSQLConf(pairs: (String, String)*)(f: => Unit): Unit = {
27872789
SparkSession.setActiveSession(spark)
27882790
super.withSQLConf(pairs: _*)(f)
2789-
@@ -434,6 +478,8 @@ private[sql] trait SQLTestUtilsBase
2791+
@@ -434,6 +480,8 @@ private[sql] trait SQLTestUtilsBase
27902792
val schema = df.schema
27912793
val withoutFilters = df.queryExecution.executedPlan.transform {
27922794
case FilterExec(_, child) => child

dev/diffs/3.5.6.diff

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ index abe606ad9c1..2d930b64cca 100644
26812681
val tblTargetName = "tbl_target"
26822682
val tblSourceQualified = s"default.$tblSourceName"
26832683
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
2684-
index e937173a590..18c0232014b 100644
2684+
index e937173a590..ca06132102d 100644
26852685
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
26862686
+++ b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
26872687
@@ -27,6 +27,7 @@ import scala.concurrent.duration._
@@ -2700,7 +2700,7 @@ index e937173a590..18c0232014b 100644
27002700
import org.apache.spark.sql.execution.FilterExec
27012701
import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecution
27022702
import org.apache.spark.sql.execution.datasources.DataSourceUtils
2703-
@@ -126,7 +128,26 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
2703+
@@ -126,7 +128,28 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
27042704
}
27052705
}
27062706
} else {
@@ -2709,8 +2709,10 @@ index e937173a590..18c0232014b 100644
27092709
+ ignore(testName + " (disabled when Comet is on)", testTags: _*)(testFun)
27102710
+ } else {
27112711
+ val cometScanImpl = CometConf.COMET_NATIVE_SCAN_IMPL.get(conf)
2712-
+ val isNativeIcebergCompat = cometScanImpl == CometConf.SCAN_NATIVE_ICEBERG_COMPAT
2713-
+ val isNativeDataFusion = cometScanImpl == CometConf.SCAN_NATIVE_DATAFUSION
2712+
+ val isNativeIcebergCompat = cometScanImpl == CometConf.SCAN_NATIVE_ICEBERG_COMPAT ||
2713+
+ cometScanImpl == CometConf.SCAN_AUTO
2714+
+ val isNativeDataFusion = cometScanImpl == CometConf.SCAN_NATIVE_DATAFUSION ||
2715+
+ cometScanImpl == CometConf.SCAN_AUTO
27142716
+ if (isCometEnabled && isNativeIcebergCompat &&
27152717
+ testTags.exists(_.isInstanceOf[IgnoreCometNativeIcebergCompat])) {
27162718
+ ignore(testName + " (disabled for NATIVE_ICEBERG_COMPAT)", testTags: _*)(testFun)
@@ -2728,7 +2730,7 @@ index e937173a590..18c0232014b 100644
27282730
}
27292731
}
27302732

2731-
@@ -242,6 +263,29 @@ private[sql] trait SQLTestUtilsBase
2733+
@@ -242,6 +265,29 @@ private[sql] trait SQLTestUtilsBase
27322734
protected override def _sqlContext: SQLContext = self.spark.sqlContext
27332735
}
27342736

@@ -2758,7 +2760,7 @@ index e937173a590..18c0232014b 100644
27582760
protected override def withSQLConf(pairs: (String, String)*)(f: => Unit): Unit = {
27592761
SparkSession.setActiveSession(spark)
27602762
super.withSQLConf(pairs: _*)(f)
2761-
@@ -435,6 +479,8 @@ private[sql] trait SQLTestUtilsBase
2763+
@@ -435,6 +481,8 @@ private[sql] trait SQLTestUtilsBase
27622764
val schema = df.schema
27632765
val withoutFilters = df.queryExecution.executedPlan.transform {
27642766
case FilterExec(_, child) => child

dev/diffs/4.0.0-preview1.diff

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,7 @@ index af07aceaed1..ed0b5e6d9be 100644
29112911
val tblTargetName = "tbl_target"
29122912
val tblSourceQualified = s"default.$tblSourceName"
29132913
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
2914-
index 5fbf379644f..8bdb733fec5 100644
2914+
index 5fbf379644f..d0575e1df69 100644
29152915
--- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
29162916
+++ b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
29172917
@@ -27,6 +27,7 @@ import scala.jdk.CollectionConverters._
@@ -2939,7 +2939,7 @@ index 5fbf379644f..8bdb733fec5 100644
29392939
if (testTags.exists(_.isInstanceOf[DisableAdaptiveExecution])) {
29402940
super.test(testName, testTags: _*) {
29412941
withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") {
2942-
@@ -127,7 +129,26 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
2942+
@@ -127,7 +129,28 @@ private[sql] trait SQLTestUtils extends SparkFunSuite with SQLTestUtilsBase with
29432943
}
29442944
}
29452945
} else {
@@ -2948,8 +2948,10 @@ index 5fbf379644f..8bdb733fec5 100644
29482948
+ ignore(testName + " (disabled when Comet is on)", testTags: _*)(testFun)
29492949
+ } else {
29502950
+ val cometScanImpl = CometConf.COMET_NATIVE_SCAN_IMPL.get(conf)
2951-
+ val isNativeIcebergCompat = cometScanImpl == CometConf.SCAN_NATIVE_ICEBERG_COMPAT
2952-
+ val isNativeDataFusion = cometScanImpl == CometConf.SCAN_NATIVE_DATAFUSION
2951+
+ val isNativeIcebergCompat = cometScanImpl == CometConf.SCAN_NATIVE_ICEBERG_COMPAT ||
2952+
+ cometScanImpl == CometConf.SCAN_AUTO
2953+
+ val isNativeDataFusion = cometScanImpl == CometConf.SCAN_NATIVE_DATAFUSION ||
2954+
+ cometScanImpl == CometConf.SCAN_AUTO
29532955
+ if (isCometEnabled && isNativeIcebergCompat &&
29542956
+ testTags.exists(_.isInstanceOf[IgnoreCometNativeIcebergCompat])) {
29552957
+ ignore(testName + " (disabled for NATIVE_ICEBERG_COMPAT)", testTags: _*)(testFun)
@@ -2967,7 +2969,7 @@ index 5fbf379644f..8bdb733fec5 100644
29672969
}
29682970
}
29692971

2970-
@@ -243,6 +264,29 @@ private[sql] trait SQLTestUtilsBase
2972+
@@ -243,6 +266,29 @@ private[sql] trait SQLTestUtilsBase
29712973
protected override def _sqlContext: SQLContext = self.spark.sqlContext
29722974
}
29732975

@@ -2997,7 +2999,7 @@ index 5fbf379644f..8bdb733fec5 100644
29972999
protected override def withSQLConf[T](pairs: (String, String)*)(f: => T): T = {
29983000
SparkSession.setActiveSession(spark)
29993001
super.withSQLConf(pairs: _*)(f)
3000-
@@ -434,6 +478,8 @@ private[sql] trait SQLTestUtilsBase
3002+
@@ -434,6 +480,8 @@ private[sql] trait SQLTestUtilsBase
30013003
val schema = df.schema
30023004
val withoutFilters = df.queryExecution.executedPlan.transform {
30033005
case FilterExec(_, child) => child

0 commit comments

Comments
 (0)