Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/20751#discussion_r172833114
--- 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 --
The major concern I have on this is performance. Referencing an outer
object means that is is put into an array and every time it is called we have
an array reference call and a cast before its usage. I saw many concerns in
previous PRs on codegen about doing these things in order not to affect
performances.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]