NathanChung4 opened a new pull request, #50877:
URL: https://github.com/apache/arrow/pull/50877
### Rationale for this change
This change was made because it refactored ToJSON() to build JSON through a
proper writer instead of hand-built strings, which removes a correctness risk.
It also aligns the codebase's ongoing transition away from manual JSON
construction.
### What changes are included in this PR?
This PR focused on changing the 8 ToJSON() functions from hand built strings
to using JsonWriter. In addition, the test files (schema_test.cc,
reader_test.cc) were also updated to reflect these changes. Finally,
WriteCrsKeyAndValue were no longer needed so it was deleted.
### Are these changes tested?
These changes are tested and verified. There was a parquet-schema-test in
which 41/41 testcases passed. There was a parquet-reader-test in which 149/154
passed and 5 were skipped as they were unrelated. A Full ctest -R "^parquet-":
11/11 suites passed. And finally the pre-commit (C++ Format + C++ Lint) came
out clean.
### Are there any user-facing changes?
Yes, there are user-facing changes. ToJSON() now produces compact JSON
instead of spaced JSON. It's the same valid JSON, but different exact bytes:
- Before: {"Type": "Decimal", "precision": 10, "scale": 4}
- After: {"Type":"Decimal","precision":10,"scale":4}
### AI Disclosure
Per the AI-generated code guidance: the 8 ToJSON() transitions to
JsonWriter, test file changes, the merge conflict resolutions, and the test
were produced with Claude Code, and reviewed and verified by me. Correctness
was checked by rebuilding and running the relevant test after every single
function conversion, not just once at the end. In addition, catching two
mistakes early via failing tests (the Decimal attempt that dropped fields, the
Int attempt that did the same).
--
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]