ulysses-you commented on code in PR #47533: URL: https://github.com/apache/spark/pull/47533#discussion_r1697849217
########## sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/BroadcastExchangeExec.scala: ########## @@ -61,23 +61,33 @@ trait BroadcastExchangeLike extends Exchange { */ def relationFuture: Future[broadcast.Broadcast[Any]] + @transient + private lazy val triggerFuture: Future[Any] = { + SQLExecution.withThreadLocalCaptured(session, BroadcastExchangeExec.executionContext) { + // Trigger broadcast preparation which can involve expensive operations like waiting on + // subqueries and file listing. + executeQuery(null) + null + } + } + + protected def completionFuture: scala.concurrent.Future[broadcast.Broadcast[Any]] + /** * The asynchronous job that materializes the broadcast. It's used for registering callbacks on * `relationFuture`. Note that calling this method may not start the execution of broadcast job. * It also does the preparations work, such as waiting for the subqueries. */ - final def submitBroadcastJob: scala.concurrent.Future[broadcast.Broadcast[Any]] = executeQuery { Review Comment: Before the shuffle stage DAG would contain exchange node... <img width="422" alt="image" src="https://github.com/user-attachments/assets/703df467-6f1e-4391-a2f4-89e7b0bb58ae"> -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org