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

    https://github.com/apache/spark/pull/20756#discussion_r173070339
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
 ---
    @@ -1261,8 +1261,39 @@ case class InitializeJavaBean(beanInstance: 
Expression, setters: Map[String, Exp
       override def children: Seq[Expression] = beanInstance +: 
setters.values.toSeq
       override def dataType: DataType = beanInstance.dataType
     
    -  override def eval(input: InternalRow): Any =
    -    throw new UnsupportedOperationException("Only code-generated 
evaluation is supported.")
    +  private lazy val resolvedSetters = {
    +    val ObjectType(beanClass) = beanInstance.dataType
    --- End diff --
    
    better to put `assert(beanInstance.dataType.isInstanceOf[ObjectType])` in 
the constructor?


---

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

Reply via email to