squito commented on code in PR #48304:
URL: https://github.com/apache/spark/pull/48304#discussion_r1815557025


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/JavaTypeInferenceSuite.scala:
##########
@@ -279,4 +279,36 @@ class JavaTypeInferenceSuite extends SparkFunSuite {
       ))
     assert(encoder === expected)
   }
+
+  test("SPARK-46679: resolve generics with multi-level inheritance different 
type names") {
+    val encoder = JavaTypeInference.encoderFor(classOf[CompanyWrapper])
+    val expected =
+      JavaBeanEncoder(ClassTag(classOf[CompanyWrapper]), Seq(
+        encoderField("name", StringEncoder),
+        encoderField("team", 
JavaBeanEncoder(ClassTag(classOf[Team[PersonData]]), Seq(
+          encoderField("name", StringEncoder),
+          encoderField("person", 
JavaBeanEncoder(ClassTag(classOf[PersonData]), Seq(
+            encoderField("firstName", StringEncoder),
+            encoderField("id", StringEncoder)
+          )))
+        )))
+      ))
+    assert(encoder === expected)
+  }
+
+  test("SPARK-46679: resolve generics with multi-level inheritance same type 
names") {
+    val encoder = JavaTypeInference.encoderFor(classOf[CompanyWrapperT])

Review Comment:
   oops, sorry ignore this, I made a mistake posting my comments to github 
earlier.  I meant to post this, but I think the simplification done already is 
fine



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to