Skip to content
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

Support reading DecimalArray from JSON data #2900

Closed
nevi-me opened this issue Oct 20, 2022 · 1 comment · Fixed by #3805
Closed

Support reading DecimalArray from JSON data #2900

nevi-me opened this issue Oct 20, 2022 · 1 comment · Fixed by #3805
Assignees
Labels
enhancement Any new improvement worthy of a entry in the changelog

Comments

@nevi-me
Copy link
Contributor

nevi-me commented Oct 20, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The JSON reader doesn't support producing DecimalArray types. I have a TODO: this is incomplete that I left on the reader 2 years ago, which was from when DecimalArray support was incomplete/not implemented.

Describe the solution you'd like

For the JSON reader to be able to produce decimal arrays if specified in the schema.

Describe alternatives you've considered

Coercing decimals to strings or f64, and then casting them after reading. This is inefficient and requires one to programmatically check each field of a schema for JSON fields in order to cast them. Worse as the decimal could be nested inside a list or struct.

Additional context

Systems have some freedom when producing JSON data. For example, Debezium has 3 modes for handling decimals [0], where decimals can either be binary, strings or floats. I also vaguely remember some system/process writing the data as bytes.
It would be useful for us to be able to handle at least the modes supported by Debezium.

[0] https://debezium.io/documentation/reference/stable/connectors/sqlserver.html#sqlserver-property-decimal-handling-mode

@nevi-me nevi-me added the enhancement Any new improvement worthy of a entry in the changelog label Oct 20, 2022
@nevi-me nevi-me self-assigned this Oct 20, 2022
@tustvold
Copy link
Contributor

#2580 is possibly related / could share some logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants