-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Records with additional constructors failed to deserialize #3968
Comments
What happens if you use v2.15.2? v2.15.0 introduced some big changes for |
Still the same in v2.15.2. I'll propose a PR to fix this since it is caused by #3724. |
Yes, I think this case should work. Ideally it would just work without changes, using the Canonical constructor and not being bothered about secondary one. @yihtserns Why is the secondary constructor even considered here? I guess the problem is two-fold:
In this case perhaps unification of POJO handling (POJOs do not have canonical constructors) and Records caused more problems than worth... again. :-/ Anyway: I hope to review the PR and see if that works. I wish it didn't have to change defaulting but would rather handle preference/priority of 3 levels we have (highest: annotated/explicit; medium: canonical; lowest: visible/public non-canonical). |
Because they may be considered for implicit delegating creator: Lines 53 to 75 in 2cea7c9
Lines 277 to 298 in 2cea7c9
Yeah sorry about that. I'm regretting it a lot. |
@yihtserns Don't regret too much; it wasn't possible to really know all the issues... partly due to limited test coverage. |
Fixed via #3969 to be included eventually in 2.15.3 |
### What changes were proposed in this pull request? The pr aims to upgrade FasterXML jackson from 2.15.2 to 2.16.0. ### Why are the changes needed? New version that fix some bugs, release notes as follows: - 2.1.6.0 https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.16, eg: [Databind](https://github.com/FasterXML/jackson-databind) [#1770](FasterXML/jackson-databind#1770): Incorrect deserialization for BigDecimal numbers - 2.15.3 https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15.3, eg: [Databind](https://github.com/FasterXML/jackson-databind) [#3968](FasterXML/jackson-databind#3968): Records with additional constructors failed to deserialize The last upgrade occurred 6 months ago, #41414 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #43859 from panbingkun/SPARK-45967. Authored-by: panbingkun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
The pr aims to upgrade FasterXML jackson from 2.15.2 to 2.16.0. New version that fix some bugs, release notes as follows: - 2.1.6.0 https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.16, eg: [Databind](https://github.com/FasterXML/jackson-databind) [apache#1770](FasterXML/jackson-databind#1770): Incorrect deserialization for BigDecimal numbers - 2.15.3 https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15.3, eg: [Databind](https://github.com/FasterXML/jackson-databind) [apache#3968](FasterXML/jackson-databind#3968): Records with additional constructors failed to deserialize The last upgrade occurred 6 months ago, apache#41414 No. Pass GA. No. Closes apache#43859 from panbingkun/SPARK-45967. Authored-by: panbingkun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
Describe the bug
Records are not deserialized as before due to error:
See the test below for the exact setup.
Version information
Which Jackson version(s) was this for?
2.15.0
To Reproduce
Expected behavior
The exact combination of configuration is not working in version 2.15.0.
There are 4 ways to fix it:
ParameterNamesModule
USE_PROPERTIES_BASED
constructor detection@JsonIgnore
annotation to the extra constructorAdditional context
The caveat here is that I can't use explicit
@JsonCreator
annotation on the primary constructor on arecord
(or I have to implement it just to add the annotation). Ideally, you should restore the old behavior. The@JsonIgnore
approach seems like a hack to me.The text was updated successfully, but these errors were encountered: