You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2026/08/18 22:05:49 UTC
Re: [PR] GH-50901: [C++] Replace RapidJSON with simdjson in tensor extension types [arrow]
kou commented on code in PR #50874:
URL: https://github.com/apache/arrow/pull/50874#discussion_r3808299529
##########
cpp/src/arrow/extension/fixed_shape_tensor.cc:
##########
@@ -116,60 +115,189 @@ Result<std::shared_ptr<DataType>> FixedShapeTensorType::Deserialize(
return Status::Invalid("Expected FixedSizeList storage type, got ",
storage_type->ToString());
}
+
auto fsl_type = internal::checked_pointer_cast<FixedSizeListType>(storage_type);
auto value_type = fsl_type->value_type();
- rj::Document document;
- if (document.Parse(serialized_data.data(), serialized_data.length()).HasParseError() ||
- !document.IsObject() || !document.HasMember("shape") ||
- !document["shape"].IsArray()) {
+
+ simdjson::padded_string padded_json(serialized_data);
+ simdjson::ondemand::parser parser;
+ simdjson::ondemand::document document;
+
+ if (auto error = parser.iterate(padded_json).get(document);
+ error != simdjson::SUCCESS) {
Review Comment:
Could you avoid `if (error = ...; error != ...) {` style for readability?
```suggestion
auto error = parser.iterate(padded_json).get(document);
if (error != simdjson::SUCCESS) {
```
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org