xupefei commented on code in PR #49111:
URL: https://github.com/apache/spark/pull/49111#discussion_r1941114531


##########
sql/api/src/main/scala/org/apache/spark/sql/expressions/ReduceAggregator.scala:
##########
@@ -27,10 +27,11 @@ import org.apache.spark.sql.{Encoder, Encoders}
  *
  * This class currently assumes there is at least one input row.
  */
+@SerialVersionUID(5066084382969966160L)
 private[sql] class ReduceAggregator[T: Encoder](func: (T, T) => T)
     extends Aggregator[T, (Boolean, T), T] {
 
-  @transient private val encoder = implicitly[Encoder[T]]
+  @transient private lazy val encoder = implicitly[Encoder[T]]

Review Comment:
   This transient encoder won't be serialised, so upon de-serialisation it'll 
be `null`. We now make it a `def`/`lazy val` so it can be re-calculated.



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

Reply via email to