Skip to content

Commit 05615f6

Browse files
committed
test: extend SPARK-43402 plan-match to CometNativeScanExec and retag to #4042
The SubquerySuite "SPARK-43402: FileSourceScanExec supports push down data filter with scalar subquery" test was tagged against #3315 in #4041 for native_datafusion. Its first failure was just a missed pattern match; adding CometNativeScanExec to the plan collection gets past that assertion, but the test then fails on a genuine behavior gap: the pushed scalar subquery is a plain Subquery rather than ReusedSubqueryExec, so reuse does not happen. Extend the test's plan-match to cover CometNativeScanExec (paralleling the existing FileSourceScanLike and CometScanExec cases) and retag the ignore to the new narrower tracking issue #4042.
1 parent b98a736 commit 05615f6

1 file changed

Lines changed: 8 additions & 54 deletions

File tree

dev/diffs/4.0.1.diff

Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -833,57 +833,6 @@ index 9c529d14221..a046f1ed1ca 100644
833833
}.flatten
834834
assert(filters.contains(GreaterThan(scan.logicalPlan.output.head, Literal(5L))))
835835
}
836-
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/IgnoreComet.scala b/sql/core/src/test/scala/org/apache/spark/sql/IgnoreComet.scala
837-
new file mode 100644
838-
index 00000000000..5691536c114
839-
--- /dev/null
840-
+++ b/sql/core/src/test/scala/org/apache/spark/sql/IgnoreComet.scala
841-
@@ -0,0 +1,45 @@
842-
+/*
843-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
844-
+ * contributor license agreements. See the NOTICE file distributed with
845-
+ * this work for additional information regarding copyright ownership.
846-
+ * The ASF licenses this file to You under the Apache License, Version 2.0
847-
+ * (the "License"); you may not use this file except in compliance with
848-
+ * the License. You may obtain a copy of the License at
849-
+ *
850-
+ * http://www.apache.org/licenses/LICENSE-2.0
851-
+ *
852-
+ * Unless required by applicable law or agreed to in writing, software
853-
+ * distributed under the License is distributed on an "AS IS" BASIS,
854-
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
855-
+ * See the License for the specific language governing permissions and
856-
+ * limitations under the License.
857-
+ */
858-
+
859-
+package org.apache.spark.sql
860-
+
861-
+import org.scalactic.source.Position
862-
+import org.scalatest.Tag
863-
+
864-
+import org.apache.spark.sql.test.SQLTestUtils
865-
+
866-
+/**
867-
+ * Tests with this tag will be ignored when Comet is enabled (e.g., via `ENABLE_COMET`).
868-
+ */
869-
+case class IgnoreComet(reason: String) extends Tag("DisableComet")
870-
+case class IgnoreCometNativeIcebergCompat(reason: String) extends Tag("DisableComet")
871-
+case class IgnoreCometNativeDataFusion(reason: String) extends Tag("DisableComet")
872-
+case class IgnoreCometNativeScan(reason: String) extends Tag("DisableComet")
873-
+
874-
+/**
875-
+ * Helper trait that disables Comet for all tests regardless of default config values.
876-
+ */
877-
+trait IgnoreCometSuite extends SQLTestUtils {
878-
+ override protected def test(testName: String, testTags: Tag*)(testFun: => Any)
879-
+ (implicit pos: Position): Unit = {
880-
+ if (isCometEnabled) {
881-
+ ignore(testName + " (disabled when Comet is on)", testTags: _*)(testFun)
882-
+ } else {
883-
+ super.test(testName, testTags: _*)(testFun)
884-
+ }
885-
+ }
886-
+}
887836
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/InjectRuntimeFilterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/InjectRuntimeFilterSuite.scala
888837
index 7d7185ae6c1..442a5bddeb8 100644
889838
--- a/sql/core/src/test/scala/org/apache/spark/sql/InjectRuntimeFilterSuite.scala
@@ -1319,7 +1268,7 @@ index 0df7f806272..92390bd819f 100644
13191268

13201269
test("non-matching optional group") {
13211270
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
1322-
index 2e33f6505ab..3a8b154b565 100644
1271+
index 2e33f6505ab..8fca1231d66 100644
13231272
--- a/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
13241273
+++ b/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala
13251274
@@ -23,11 +23,13 @@ import org.apache.spark.SparkRuntimeException
@@ -1365,13 +1314,13 @@ index 2e33f6505ab..3a8b154b565 100644
13651314
}
13661315
assert(exchanges.size === 1)
13671316
}
1368-
@@ -2674,22 +2688,31 @@ class SubquerySuite extends QueryTest
1317+
@@ -2674,22 +2688,36 @@ class SubquerySuite extends QueryTest
13691318
}
13701319
}
13711320

13721321
- test("SPARK-43402: FileSourceScanExec supports push down data filter with scalar subquery") {
13731322
+ test("SPARK-43402: FileSourceScanExec supports push down data filter with scalar subquery",
1374-
+ IgnoreCometNativeDataFusion("https://github.com/apache/datafusion-comet/issues/3315")) {
1323+
+ IgnoreCometNativeDataFusion("https://github.com/apache/datafusion-comet/issues/4042")) {
13751324
def checkFileSourceScan(query: String, answer: Seq[Row]): Unit = {
13761325
val df = sql(query)
13771326
checkAnswer(df, answer)
@@ -1380,6 +1329,7 @@ index 2e33f6505ab..3a8b154b565 100644
13801329
+ val dataSourceScanExec = collect(df.queryExecution.executedPlan) {
13811330
+ case f: FileSourceScanLike => f
13821331
+ case c: CometScanExec => c
1332+
+ case n: CometNativeScanExec => n
13831333
}
13841334
sparkContext.listenerBus.waitUntilEmpty()
13851335
- assert(fileSourceScanExec.size === 1)
@@ -1396,6 +1346,10 @@ index 2e33f6505ab..3a8b154b565 100644
13961346
+ c.dataFilters.flatMap(_.collect {
13971347
+ case s: ScalarSubquery => s
13981348
+ })
1349+
+ case n: CometNativeScanExec =>
1350+
+ n.dataFilters.flatMap(_.collect {
1351+
+ case s: ScalarSubquery => s
1352+
+ })
13991353
+ }
14001354
assert(scalarSubquery.length === 1)
14011355
assert(scalarSubquery.head.plan.isInstanceOf[ReusedSubqueryExec])

0 commit comments

Comments
 (0)