szehon-ho commented on code in PR #52444:
URL: https://github.com/apache/spark/pull/52444#discussion_r2379972485
##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/JavaTypeInference.scala:
##########
@@ -139,7 +139,9 @@ object JavaTypeInference {
encoderFor(typeVariables(tv), seenTypeSet, typeVariables)
case pt: ParameterizedType =>
- encoderFor(pt.getRawType, seenTypeSet,
JavaTypeUtils.getTypeArguments(pt).asScala.toMap)
+ val newTvs = JavaTypeUtils.getTypeArguments(pt).asScala.toMap
Review Comment:
For reference, a walkthrough:
```
StringFooWrapper extends FooWrapper<String>
FooWrapper<U> contains Foo<U>
Foo<T>
```
On the first call for StringFooWrapper, typeVariable map contains (U =>
String)
On the next recursive call for FooWrapper, this gets overriden by (T => U)
The correct behavior is to keep both (U => String) and (T => U) in the final
Encoder's typeVariable map.
--
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]