GH-50859: [C++][Parquet] Move JsonWriter to simdjson utilities - #50990
GH-50859: [C++][Parquet] Move JsonWriter to simdjson utilities#50990rok wants to merge 5 commits into
Conversation
|
The CI failures need fixing. |
|
@pitrou done. |
Done |
|
Again, this PR is purely AI generated. I will mark as ready for review once I review myself. |
|
@rok Are you willing to prioritize this? |
|
@pitrou I'll review this in about an hour and ping again |
|
@github-actions crossbow submit example-cpp-tutorial |
|
Revision: 973b4d2 Submitted crossbow builds: ursacomputing/crossbow @ actions-5765e8701c
|
Parquet uses JsonWriter independently of the Arrow JSON module. Move the writer into the simdjson utilities so it is available whenever simdjson is enabled, including ARROW_JSON=OFF builds. Preserve the writer files as renames and update CMake, Meson, callers, and tests.
973b4d2 to
5a1f424
Compare
| SOURCES | ||
| json_writer_internal_test.cc | ||
| EXTRA_LINK_LIBS | ||
| simdjson::simdjson) |
There was a problem hiding this comment.
Should we use arrow::simdjson here instead? Both should work, but arrow alieas would hide the vendored/system simdjson.
There was a problem hiding this comment.
if(SIMDJSON_VENDORED)
add_library(arrow::simdjson ALIAS simdjson)
else()
add_library(arrow::simdjson ALIAS simdjson::simdjson)
endif()
It seems better to use arrow::simdjson based on the above statements? cc @kou
There was a problem hiding this comment.
Agreed, changed to arrow::simdjson.
|
@github-actions crossbow submit example-cpp-tutorial |
|
Revision: 86e85bd Submitted crossbow builds: ursacomputing/crossbow @ actions-e4578321bd
|
|
Revision: ab2c41a Submitted crossbow builds: ursacomputing/crossbow @ actions-af7350541b
|
|
@github-actions crossbow submit -g cpp |
|
|
||
| Status JsonWriter::WriteValue(sj::value value) { | ||
| return internal::VisitJsonValue( | ||
| return ::arrow::internal::VisitJsonValue( |
There was a problem hiding this comment.
I think we don't need to add this prefix.
There was a problem hiding this comment.
I think redundant namespace is now gone, see here.
|
Revision: ab2c41a Submitted crossbow builds: ursacomputing/crossbow @ actions-f7784ce147 |
|
Why not put everything in |
| ARROW_UTIL_SRCS | ||
| json/object_parser.cc |
There was a problem hiding this comment.
If object_parser.cc is necessary even with ARROW_JSON disabled, perhaps it should be moved outside of the json directory? It seems it's Parquet-only by the way.
There was a problem hiding this comment.
Moved to simdjson_internal as well.
@pitrou done. Read and write utilities are now bundled together as they share simdjson helpers are internal-only. |
|
@github-actions crossbow submit -g cpp |
|
Revision: ea1bc35 Submitted crossbow builds: ursacomputing/crossbow @ actions-9ebf88aa33 |
|
|
||
| /// This class is a helper to parse a JSON object from a string. | ||
| /// It uses simdjson in the implementation. | ||
| class ARROW_EXPORT ObjectParser { |
There was a problem hiding this comment.
Sorry for another nit, but arrow::internal::ObjectParser doesn't give any clue that it's about JSON anymore :-)
Should we name it JsonObjectParser perhaps?
Rationale for this change
Parquet uses JsonWriter when ARROW_JSON=OFF, but its implementation was only built with Arrow JSON, causing link failures.
What changes are included in this PR?
Move JsonWriter to the simdjson utilities and update its callers and CMake/Meson builds.
Are these changes tested?
Yes. CMake shared/static and Meson Parquet builds pass with JSON disabled. Unit tests and pre-commit checks also pass.
Are there any user-facing changes?
No. This only fixes the affected build configuration.
AI disclosure - this was AI generated to test alternative approach to #50900.