Github user hvanhovell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20751#discussion_r172835939
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
 ---
    @@ -105,6 +105,66 @@ trait InvokeLike extends Expression with 
NonSQLExpression {
       }
     }
     
    +/**
    + * Common trait for [[DecodeUsingSerializer]] and [[EncodeUsingSerializer]]
    + */
    +trait BaseSerializer {
    +  /**
    +   * If true, Kryo serialization is used, otherwise the Java one is used
    +   */
    +  val kryo: Boolean
    +
    +  /**
    +   * The serializer instance to be used for serialization/deserialization
    +   */
    +  lazy val serializerInstance = {
    --- End diff --
    
    I was talking about the code below (the comment was somewhat terse). We 
should definitely put the `serializerInstance` into a the generated classes 
immutable state. All I am saying is that is that we can put the factory code 
below in a companion, and use that in both the generated and interpreted code 
paths. This reduces the amount of code generated, and also makes things easier 
to test.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to