comphead commented on code in PR #2982:
URL: https://github.com/apache/datafusion-comet/pull/2982#discussion_r2644497635
##########
spark/src/test/scala/org/apache/comet/parquet/CometParquetWriterSuite.scala:
##########
@@ -97,20 +98,25 @@ class CometParquetWriterSuite extends CometTestBase {
s"Listener was not called within ${maxWaitTimeMs}ms - no execution
plan captured")
capturedPlan.foreach { qe =>
- val executedPlan = qe.executedPlan
- val hasNativeWrite = executedPlan.exists {
- case _: CometNativeWriteExec => true
+ val executedPlan = stripAQEPlan(qe.executedPlan)
+
+ // Count CometNativeWriteExec instances in the plan
+ var nativeWriteCount = 0
+ executedPlan.foreach {
+ case _: CometNativeWriteExec =>
+ nativeWriteCount += 1
case d: DataWritingCommandExec =>
- d.child.exists {
- case _: CometNativeWriteExec => true
- case _ => false
+ d.child.foreach {
+ case _: CometNativeWriteExec =>
+ nativeWriteCount += 1
+ case _ =>
}
- case _ => false
+ case _ =>
}
assert(
- hasNativeWrite,
- s"Expected CometNativeWriteExec in the plan, but
got:\n${executedPlan.treeString}")
+ nativeWriteCount == 1,
Review Comment:
check the count is just 1
--
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]