gbloisi-openaire opened a new pull request, #42914:
URL: https://github.com/apache/spark/pull/42914
### What changes were proposed in this pull request?
This pull request adds Encoders.bean support for beans having a superclass
declared with generic type arguments.
For example:
```
class JavaBeanWithGenericsA<T> {
public T getPropertyA() {
return null;
}
public void setPropertyA(T a) {
}
}
class JavaBeanWithGenericBase extends JavaBeanWithGenericsA<String> {
}
Encoders.bean(JavaBeanWithGenericBase.class); // Exception
```
That feature had to be part of [PR
42327](https://github.com/apache/spark/commit/1f5d78b5952fcc6c7d36d3338a5594070e3a62dd)
but was missing as I was focusing on nested beans only (@hvanhovell )
### Why are the changes needed?
JavaTypeInference.encoderFor did not solve TypeVariable objects for
superclasses so when managing a case like in the example above an exception was
thrown.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Existing tests have been extended, new specific tests have been added
### Was this patch authored or co-authored using generative AI tooling?
No
@hvanhovell this is branch-3.4 port of
[PR-42634](https://github.com/apache/spark/pull/42634)
--
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]