Github user bdrillard commented on a diff in the pull request:
https://github.com/apache/spark/pull/20085#discussion_r161607649
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -1237,47 +1342,91 @@ case class DecodeUsingSerializer[T](child:
Expression, tag: ClassTag[T], kryo: B
}
/**
- * Initialize a Java Bean instance by setting its field values via setters.
+ * Initialize an object by invoking the given sequence of method names and
method arguments.
+ *
+ * @param objectInstance An expression evaluating to a new instance of the
object to initialize
+ * @param setters A sequence of method names and their sequence of
argument expressions to apply in
+ * series to the object instance
*/
-case class InitializeJavaBean(beanInstance: Expression, setters:
Map[String, Expression])
+case class InitializeObject(
+ objectInstance: Expression,
+ setters: Seq[(String, Seq[Expression])])
--- End diff --
We can make use of `NewInstance` which just creates an object of a class,
but it's not clear how we can make use of a sequence of `Invoke`, since all
these setter methods would have `void` return types, we can't chain them in a
fluent manner.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]