osipovartem opened a new pull request, #11409: URL: https://github.com/apache/arrow-rs/pull/11409
## Why This extracts the direct JSON parser from #11177 into a reviewable change without enabling fixed-point decimal conversion yet. The existing `arrow-json` tape converts ordinary fractional numbers to `f64`, so it cannot provide the original lexemes needed for a follow-up exact-decimal change. ## Change - Parse JSON directly into `VariantBuilderExt` without materializing a `serde_json::Value` tree. - Borrow unescaped strings; decode escaped strings only when necessary. - Preserve the existing smallest-width integer encoding and `serde_json::Number` fallback bits for other numbers, including negative zero. - Bound nesting depth and validate the complete root before finishing it. - Report duplicate keys as errors when unique-field validation is enabled; the former `Value` path had already collapsed duplicates before reaching the builder. ## Dependencies and review status **Draft: do not merge yet.** This branch is stacked on #11106 for fallible builder appends and requires #11403 for correct object-field rollback after an append error. Its diff against `main` includes the #11106 commit until that PR merges. For duplicate keys with validation disabled, the direct builder retains overwritten payload bytes. A 100 KB overwritten string measured about 44 us on the direct path versus 9 us through the `Value` tree. The output is still last-key-wins and memory is bounded by input size, but duplicate-heavy inputs need an explicit pre-merge decision: accept the tradeoff or add a parser-specific fallback. This does not affect the common unique-key path. ## Validation - `cargo +1.98.1 test -p parquet-variant-json`: 60 passed, 13 pre-existing decimal tests remain ignored, 6 doctests passed. - `cargo +1.98.1 clippy -p parquet-variant-json --all-targets -- -D warnings`: passed (the installed Clippy reports one pre-existing unknown lint warning from the workspace configuration). - Independent read-only review approved opening a draft, not merging before dependencies and the duplicate-key decision. The exact-decimal change and its Criterion benchmark are prepared as separate follow-up branches. -- 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]
