hvanhovell commented on code in PR #47815:
URL: https://github.com/apache/spark/pull/47815#discussion_r1745490540
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala:
##########
@@ -238,15 +245,30 @@ object SQLExecution extends Logging {
val sc = sparkSession.sparkContext
val oldExecutionId = sc.getLocalProperty(SQLExecution.EXECUTION_ID_KEY)
withSQLConfPropagated(sparkSession) {
- try {
- sc.setLocalProperty(SQLExecution.EXECUTION_ID_KEY, executionId)
- body
- } finally {
- sc.setLocalProperty(SQLExecution.EXECUTION_ID_KEY, oldExecutionId)
+ withSessionTagsApplied(sparkSession) {
+ try {
+ sc.setLocalProperty(SQLExecution.EXECUTION_ID_KEY, executionId)
+ body
+ } finally {
+ sc.setLocalProperty(SQLExecution.EXECUTION_ID_KEY, oldExecutionId)
+ }
}
}
}
+ private[sql] def withSessionTagsApplied[T](sparkSession:
SparkSession)(block: => T): T = {
+ sparkSession.sparkContext.addJobTag(sparkSession.sessionJobTag)
Review Comment:
This begs for a method that sets them all at once... you are incrementally
building a string here :)....
--
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]