dwsmith1983 commented on code in PR #6270:
URL: https://github.com/apache/datafusion-comet/pull/6270#discussion_r4286509787


##########
spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala:
##########
@@ -78,6 +78,15 @@ abstract class CometTestBase
     assert(reused.nonEmpty, s"$clue:\n$plan")
   }
 
+  /** Asserts that no reused exchange in `plan` sits over a scan that 
`dppScan` matches. */
+  protected def assertNoReusedExchangeOverDppScan[T](plan: SparkPlan)(
+      dppScan: PartialFunction[SparkPlan, T]): Unit = {
+    val reused = collect(plan) {
+      case exchange: ReusedExchangeExec if 
collect(exchange.child)(dppScan).nonEmpty => exchange
+    }
+    assert(reused.isEmpty, s"An exchange over a DPP scan was reused by another 
branch:\n$plan")
+  }

Review Comment:
   Done in 4ac089278. `reusedExchanges(plan)` collects every reused exchange, 
`reusedExchangesOver(plan)(pf)` filters it, and both asserts call that. 
`assertSameExchangeReuseAsSpark(sparkPlan, cometPlan)` now holds the count 
comparison and its message for `CometExecSuite` and 
`CometDeltaNativeScanSuite`. The Delta test keeps its own check that Spark 
reuses exactly one exchange.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to