-
-
Notifications
You must be signed in to change notification settings - Fork 141
Incorrect serialization for LogicalType.Decimal
(Java BigDecimal
)
#308
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
Comments
I believe #221 refers to the the same issue |
Sounds good -- fix against 2.13 would be appreciated. |
@cowtowncoder While the write/(serialize) path was rather easy to fix, the read path seems a bit harder. serialization happens in a mostly Jackson generic fashion, unaware that the I can register cutom In order to adhere to Avro Decimal serialization behavior described in Any ideas on how to get the correct location of the schema for that a deserializer? 10x |
I would have thought that reading/deserialization should also work fine, as long as low-level decoder uses the schema information appropriately? Although I guess if this is not the case, then various workarounds may be needed. |
@cowtowncoder Well, it's not. Any ideas on how to get the schema information there? It seems like the correct approach would to make |
Schema is carried along when constructing readers/writers, so that'd be the place to store information. |
One possible way forward here would be a (unit) test that shows incorrect handling; possibly contrasting Avro-backed decoder (which would expect properly encoded/serialized value) to Jackson one (which works with whatever serialization is currently used) to show the issue? I could probably find time to work on this in near future, but would need help reproducing the issue first (as well as then verifying the fix). |
LogicalType.Decimal
(Java BigDecimal
)
Fixed via #542. |
Your following extension
NonBSGenericDatumWriter
ofGenericDatumWriter
ignores proper support for AVRO'sLogicalType.Decimal
(not callingConversions.DecimalConversion
) when dealing withBigDecimal
types.A possible fix (inside
NonBSGenericDatumWriter
) might be:I'm willing to contribute a PR (including tests), but I'd like to apply it as a fix to 2.13.x branch.
@cowtowncoder Let me know what you think
The text was updated successfully, but these errors were encountered: