GH-50901: [C++] Replace RapidJSON with simdjson in tensor extension types - #50874
GH-50901: [C++] Replace RapidJSON with simdjson in tensor extension types#50874Reranko05 wants to merge 5 commits into
Conversation
|
Thanks for opening a pull request! This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format. If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or After updating the title, you can mark the pull request as ready for review. See also: |
dd55d0b to
298964c
Compare
298964c to
ac194ba
Compare
ac194ba to
069be12
Compare
| if (type == simdjson::ondemand::json_type::unknown) { | ||
| return Status::Invalid("Invalid serialized JSON data: ", serialized_data); | ||
| } |
There was a problem hiding this comment.
Can we remove this check? It seems that this is redundant.
There was a problem hiding this comment.
I tried removing it, but value.type() can successfully return json_type::unknown for malformed input such as {"shape":(3,4)}. Without this check, the error becomes shape must be an array, got unknown instead of the expected invalid JSON error, so I think we need to keep it.
Rationale for this change
This PR continues the simdjson migration by replacing RapidJSON usage in the
FixedShapeTensorTypeandVariableShapeTensorTypeextension types with the existing simdjson helpers and On-Demand API.Changes
FixedShapeTensorType::Deserializewith simdjson.VariableShapeTensorType::Deserializewith simdjson.JsonTypeNamehelper from the tensor extension utilities.Fixes: #50901