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

    https://github.com/apache/spark/pull/10390#discussion_r48780378
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
 ---
    @@ -242,6 +242,16 @@ class ExpressionEncoderSuite extends SparkFunSuite {
         ExpressionEncoder.tuple(intEnc, ExpressionEncoder.tuple(intEnc, 
longEnc))
       }
     
    +  test("user type with ScalaReflection") {
    +    val point = (new ExamplePoint(0.1, 0.2), new ExamplePoint(0.3, 0.4))
    +    val schema = ScalaReflection.schemaFor[Tuple2[ExamplePoint, 
ExamplePoint]]
    +      .dataType.asInstanceOf[StructType]
    +    val attributeSeq = schema.toAttributes
    +    val boundEncoder = encoderFor[Tuple2[ExamplePoint, ExamplePoint]]
    +      .resolve(attributeSeq, outers).bind(attributeSeq)
    +    assert(boundEncoder.fromRow(boundEncoder.toRow(point)) === point)
    +  }
    --- End diff --
    
    Just make this `productTest(("UDT", new ExamplePoint(0.1, 0.2)))`.  It 
always better to reuse existing infrastructure when possible.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to