Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20085#discussion_r160349007
  
    --- 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 --
    
    To generalize, I think we can just have a `NewObject` expression, which 
just do `new SomeClass`, the setters are just a bunch of `Invoke`.


---

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

Reply via email to