11diff --git a/pom.xml b/pom.xml
2- index a0e25ce4d8d..29d3b93f994 100644
2+ index a0e25ce4d8d..b95fba458f2 100644
33--- a/pom.xml
44+++ b/pom.xml
55@@ -152,6 +152,8 @@
@@ -1402,25 +1402,26 @@ index eec396b2e39..bf3f1c769d6 100644
14021402 nums.createOrReplaceTempView("nums")
14031403
14041404diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
1405- index b14f4a405f6..ab7baf434a5 100644
1405+ index b14f4a405f6..90bed10eca9 100644
14061406--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
14071407+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala
14081408@@ -23,6 +23,7 @@ import org.apache.spark.sql.QueryTest
14091409 import org.apache.spark.sql.catalyst.InternalRow
14101410 import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference}
14111411 import org.apache.spark.sql.catalyst.plans.logical.Deduplicate
1412- + import org.apache.spark.sql.comet.CometColumnarToRowExec
1412+ + import org.apache.spark.sql.comet.{ CometColumnarToRowExec, CometNativeColumnarToRowExec}
14131413 import org.apache.spark.sql.execution.datasources.v2.BatchScanExec
14141414 import org.apache.spark.sql.internal.SQLConf
14151415 import org.apache.spark.sql.test.SharedSparkSession
1416- @@ -131,7 +132,10 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession {
1416+ @@ -131,7 +132,11 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession {
14171417 spark.range(1).write.parquet(path.getAbsolutePath)
14181418 val df = spark.read.parquet(path.getAbsolutePath)
14191419 val columnarToRowExec =
14201420- df.queryExecution.executedPlan.collectFirst { case p: ColumnarToRowExec => p }.get
14211421+ df.queryExecution.executedPlan.collectFirst {
14221422+ case p: ColumnarToRowExec => p
14231423+ case p: CometColumnarToRowExec => p
1424+ + case p: CometNativeColumnarToRowExec => p
14241425+ }.get
14251426 try {
14261427 spark.range(1).foreach { _ =>
@@ -2383,7 +2384,7 @@ index d083cac48ff..3c11bcde807 100644
23832384 import testImplicits._
23842385
23852386diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
2386- index 746f289c393..a90106a1463 100644
2387+ index 746f289c393..a773971d3c1 100644
23872388--- a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
23882389+++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
23892390@@ -19,16 +19,19 @@ package org.apache.spark.sql.sources
@@ -2441,7 +2442,7 @@ index 746f289c393..a90106a1463 100644
24412442
24422443 val bucketColumnType = bucketedDataFrame.schema.apply(bucketColumnIndex).dataType
24432444 val rowsWithInvalidBuckets = fileScan.execute().filter(row => {
2444- @@ -452,28 +464,49 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2445+ @@ -452,28 +464,54 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
24452446 val joinOperator = if (joined.sqlContext.conf.adaptiveExecutionEnabled) {
24462447 val executedPlan =
24472448 joined.queryExecution.executedPlan.asInstanceOf[AdaptiveSparkPlanExec].executedPlan
@@ -2472,6 +2473,11 @@ index 746f289c393..a90106a1463 100644
24722473+ case s: SortMergeJoinExec => s
24732474+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
24742475+ }
2476+ + case CometNativeColumnarToRowExec(child) =>
2477+ + child.asInstanceOf[CometSortMergeJoinExec].originalPlan match {
2478+ + case s: SortMergeJoinExec => s
2479+ + case o => fail(s"expected SortMergeJoinExec, but found\n$o")
2480+ + }
24752481+ case o => fail(s"expected SortMergeJoinExec, but found\n$o")
24762482+ }
24772483 }
@@ -2499,7 +2505,7 @@ index 746f289c393..a90106a1463 100644
24992505 s"expected sort in the right child to be $sortRight but found\n${joinOperator.right}")
25002506
25012507 // check the output partitioning
2502- @@ -836,11 +869 ,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2508+ @@ -836,11 +874 ,11 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
25032509 df1.write.format("parquet").bucketBy(8, "i").saveAsTable("bucketed_table")
25042510
25052511 val scanDF = spark.table("bucketed_table").select("j")
@@ -2513,7 +2519,7 @@ index 746f289c393..a90106a1463 100644
25132519 checkAnswer(aggDF, df1.groupBy("j").agg(max("k")))
25142520 }
25152521 }
2516- @@ -895,7 +928 ,10 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2522+ @@ -895,7 +933 ,10 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
25172523 }
25182524
25192525 test("SPARK-29655 Read bucketed tables obeys spark.sql.shuffle.partitions") {
@@ -2524,7 +2530,7 @@ index 746f289c393..a90106a1463 100644
25242530 SQLConf.SHUFFLE_PARTITIONS.key -> "5",
25252531 SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "7") {
25262532 val bucketSpec = Some(BucketSpec(6, Seq("i", "j"), Nil))
2527- @@ -914,7 +950 ,10 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2533+ @@ -914,7 +955 ,10 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
25282534 }
25292535
25302536 test("SPARK-32767 Bucket join should work if SHUFFLE_PARTITIONS larger than bucket number") {
@@ -2535,7 +2541,7 @@ index 746f289c393..a90106a1463 100644
25352541 SQLConf.SHUFFLE_PARTITIONS.key -> "9",
25362542 SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "10") {
25372543
2538- @@ -944,7 +983 ,10 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2544+ @@ -944,7 +988 ,10 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
25392545 }
25402546
25412547 test("bucket coalescing eliminates shuffle") {
@@ -2546,7 +2552,7 @@ index 746f289c393..a90106a1463 100644
25462552 SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true",
25472553 SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") {
25482554 // The side with bucketedTableTestSpec1 will be coalesced to have 4 output partitions.
2549- @@ -1029,15 +1071 ,21 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
2555+ @@ -1029,15 +1076 ,21 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with Adapti
25502556 Seq(true, false).foreach { aqeEnabled =>
25512557 withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> aqeEnabled.toString) {
25522558 val plan = sql(query).queryExecution.executedPlan
0 commit comments