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


##########
sql/core/src/main/scala/org/apache/spark/sql/expressions/Aggregator.scala:
##########
@@ -49,6 +49,7 @@ import 
org.apache.spark.sql.execution.aggregate.TypedAggregateExpression
  * @tparam OUT The type of the final output result.
  * @since 1.6.0
  */
+@SerialVersionUID(2093413866369130093L)

Review Comment:
   I tried multiple methods and still can't succeed without this UID. As long 
as we want users to use UDAF like this:
   ```
   new Aggregator {
      def merge(...) = {...}
      ...
   }
   ```
   The serialized payload (either the whole Aggregator instance or individual 
methods) will carry a reference to the Aggregator instance that needs to be 
decoded on the server side. Without this UID, it will throw an exception. So 
far the only way I found to break this link is to declare interface methods as 
high-order functions:
   ```
   new Aggregator {
      def merge(...) = (b1, b2) => {...}
      ...
   }
   ```



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