Support for serde_json arbitrary_precision in arrow-json TapeSerializer
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 1.3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 169
Description
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.**
Using the decoder provided by arrow-json ReaderBuilder to serialize a serde_json number which was deserialized with the `arbitrary_precision` feature enabled results in an error. This is due to serde_json's use of a struct to represent the number to avoid loss in precision ([serialization](https://github.com/serde-rs/json/blob/4bc1eaa03a6160593575bc9bc60c94dba4cab1e3/src/number.rs#L385) and [deserializiation](https://github.com/serde-rs/json/blob/4bc1eaa03a6160593575bc9bc60c94dba4cab1e3/src/number.rs#L432)). The TapeSerializer understandably sees this as a struct which the associated decoders don't know how to handle.
**Describe the solution you'd like**
Serialize serde_json arbitrary_precision numbers as strings rather than structs. This will allow the decoders to properly parse the value.
**Describe alternatives you've considered**
N/A
**Additional context**
N/A
Contributor guide
Research direction
Start by tracing the arrow-json ReaderBuilder and TapeSerializer paths involved when serde_json uses its arbitrary_precision representation. Reproduce the failure with an arbitrary-precision number, then verify that the decoder accepts the serialized value without precision loss and that the relevant existing tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100