Skip to content

fix: Fix Spark SQL AQE exchange reuse test failures #1811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 2 additions & 32 deletions dev/diffs/3.5.5.diff
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ index f32b32ffc5a..447d7c6416e 100644
assert(exchanges.size == 2)
}
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
index f33432ddb6f..bd2e5ef267e 100644
index f33432ddb6f..fe9f74ff8f1 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala
@@ -22,6 +22,7 @@ import org.scalatest.GivenWhenThen
Expand All @@ -376,37 +376,7 @@ index f33432ddb6f..bd2e5ef267e 100644
case _ => Nil
}
}
@@ -755,7 +759,8 @@ abstract class DynamicPartitionPruningSuiteBase
}
}

- test("partition pruning in broadcast hash joins") {
+ test("partition pruning in broadcast hash joins",
+ IgnoreComet("TODO: Support SubqueryBroadcastExec in Comet: #1737")) {
Given("disable broadcast pruning and disable subquery duplication")
withSQLConf(
SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true",
@@ -1215,7 +1220,8 @@ abstract class DynamicPartitionPruningSuiteBase
}

test("SPARK-32509: Unused Dynamic Pruning filter shouldn't affect " +
- "canonicalization and exchange reuse") {
+ "canonicalization and exchange reuse",
+ IgnoreComet("TODO: Support SubqueryBroadcastExec in Comet: #1737")) {
withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true") {
withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") {
val df = sql(
@@ -1454,7 +1460,8 @@ abstract class DynamicPartitionPruningSuiteBase
}
}

- test("SPARK-35568: Fix UnsupportedOperationException when enabling both AQE and DPP") {
+ test("SPARK-35568: Fix UnsupportedOperationException when enabling both AQE and DPP",
+ IgnoreComet("TODO: Support SubqueryBroadcastExec in Comet: #1737")) {
val df = sql(
"""
|SELECT s.store_id, f.product_id
@@ -1729,6 +1736,8 @@ abstract class DynamicPartitionPruningV1Suite extends DynamicPartitionPruningDat
@@ -1729,6 +1733,8 @@ abstract class DynamicPartitionPruningV1Suite extends DynamicPartitionPruningDat
case s: BatchScanExec =>
// we use f1 col for v2 tables due to schema pruning
s.output.exists(_.exists(_.argString(maxFields = 100).contains("f1")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ case class EliminateRedundantTransitions(session: SparkSession) extends Rule[Spa

private def _apply(plan: SparkPlan): SparkPlan = {
val eliminatedPlan = plan transformUp {
case ColumnarToRowExec(shuffleExchangeExec: CometShuffleExchangeExec)
if (plan.conf.adaptiveExecutionEnabled) =>
shuffleExchangeExec
case ColumnarToRowExec(sparkToColumnar: CometSparkToColumnarExec) =>
if (sparkToColumnar.child.supportsColumnar) {
// For Spark Columnar to Comet Columnar, we should keep the ColumnarToRowExec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ case class CometShuffleExchangeExec(
}

protected override def doExecute(): RDD[InternalRow] = {
throw new UnsupportedOperationException(
"CometShuffleExchangeExec.doExecute should not be executed.")
ColumnarToRowExec(this).doExecute()
}

/**
Expand Down
Loading