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

    https://github.com/apache/spark/pull/20085#discussion_r159520020
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CodeGenerationSuite.scala
 ---
    @@ -436,4 +437,16 @@ class CodeGenerationSuite extends SparkFunSuite with 
ExpressionEvalHelper {
         ctx.addImmutableStateIfNotExists("String", mutableState2)
         assert(ctx.inlinedMutableStates.length == 2)
       }
    +
    +  test("InitializeObject") {
    +    val bean = new GenericBean(1, "a")
    +
    +    val encoder = Encoders.bean(classOf[GenericBean])
    +    val expressionEncoder = 
encoder.asInstanceOf[ExpressionEncoder[GenericBean]]
    +    val row = expressionEncoder.toRow(bean)
    +    val beanFromRow = expressionEncoder.resolveAndBind().fromRow(row)
    +
    +    assert(beanFromRow.getField1 == bean.getField1)
    +    assert(beanFromRow.getField2 == bean.getField2)
    +  }
    --- End diff --
    
    This test case above demonstrates the issue I encountered with using a 
sequence of initialization arguments on an object.


---

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

Reply via email to