wForget commented on code in PR #7362:
URL: https://github.com/apache/kyuubi/pull/7362#discussion_r2945327726
##########
extensions/spark/kyuubi-extension-spark-4-1/src/test/scala/org/apache/spark/sql/KyuubiSparkSQLExtensionTest.scala:
##########
@@ -100,13 +102,17 @@ trait KyuubiSparkSQLExtensionTest extends QueryTest
withListener(sql(sqlString))(callback)
}
- def withListener(df: => DataFrame)(callback: DataWritingCommand => Unit):
Unit = {
+ def withListener(df: => DataFrame, mustBeCalled: Boolean = true)(
+ callback: DataWritingCommand => Unit): Unit = {
+ val called = new AtomicBoolean(false)
val listener = new QueryExecutionListener {
override def onFailure(f: String, qe: QueryExecution, e: Exception):
Unit = {}
override def onSuccess(funcName: String, qe: QueryExecution, duration:
Long): Unit = {
- qe.executedPlan match {
- case write: DataWritingCommandExec => callback(write.cmd)
+ collect(qe.executedPlan) {
Review Comment:
`DataWritingCommandExec` is wrapped by `AdaptiveSparkPlanExec`, so we should
use `AdaptiveSparkPlanHelper#collect`
--
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]