cloud-fan commented on a change in pull request #32786:
URL: https://github.com/apache/spark/pull/32786#discussion_r648133527



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/AggregatingAccumulator.scala
##########
@@ -95,13 +95,13 @@ class AggregatingAccumulator private(
 
   /**
    * Driver side operations like `merge` and `value` are executed in the 
DAGScheduler thread. This
-   * thread does not have a SQL configuration so we attach our own here. Note 
that we can't (and
-   * shouldn't) call `merge` or `value` on an accumulator originating from an 
executor so we just
-   * return a default value here.
+   * thread does not have a SQL configuration so we attach our own here.
    */
   private[this] def withSQLConf[T](default: => T)(body: => T): T = {

Review comment:
       I think we should still forbid calling `value` on the executor side. How 
about
   ```
   def withSQLConf[T](canRunOnExecutor: Boolean, default: => T)(body: => T): T 
= {
     if (conf != null) {
       // When we reach here we are on the driver side
       SQLConf.withExistingConf(conf)(body)
     } else if (canRunOnExecutor) {
       body
     } else {
       default
     }
   }
   ```




-- 
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.

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