cloud-fan commented on a change in pull request #30766:
URL: https://github.com/apache/spark/pull/30766#discussion_r542666519
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/HashAggregateExec.scala
##########
@@ -159,7 +159,11 @@ case class HashAggregateExec(
// The variables are used as aggregation buffers and each aggregate function
has one or more
// ExprCode to initialize its buffer slots. Only used for aggregation
without keys.
- private var bufVars: Seq[Seq[ExprCode]] = _
+ private val bufVar = new ThreadLocal[Seq[Seq[ExprCode]]] {
Review comment:
I thought about this too, but my concern is that we never promise the
codegen to be thread-safe. We may have more places to fix, and we may break it
again in the future.
----------------------------------------------------------------
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]