hvanhovell commented on a change in pull request #28223: [SPARK-31450][SQL] 
Make ExpressionEncoder thread-safe
URL: https://github.com/apache/spark/pull/28223#discussion_r408717513
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala
 ##########
 @@ -162,6 +163,18 @@ object ExpressionEncoder {
       e4: ExpressionEncoder[T4],
       e5: ExpressionEncoder[T5]): ExpressionEncoder[(T1, T2, T3, T4, T5)] =
     tuple(Seq(e1, e2, e3, e4, e5)).asInstanceOf[ExpressionEncoder[(T1, T2, T3, 
T4, T5)]]
+
+  /**
+   * Function that deserializes an [[InternalRow]] into an object of type `T`. 
Instances of this
+   * class are not meant to be thread-safe.
+   */
+  abstract class Deserializer[T] extends (InternalRow => T)
 
 Review comment:
   Implementation note. I opted to go with abstract classes so we can get 
monomorphic call sites in many cases.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to