pitrou commented on code in PR #50937:
URL: https://github.com/apache/arrow/pull/50937#discussion_r3850667179


##########
cpp/src/arrow/integration/json_internal.cc:
##########
@@ -1232,34 +1238,44 @@ template <typename FieldOrStruct>
 Result<std::shared_ptr<KeyValueMetadata>> GetKeyValueMetadata(
     const FieldOrStruct& field_or_struct) {
   auto metadata = std::make_shared<KeyValueMetadata>();
-  auto it = field_or_struct.FindMember("metadata");
-  if (it == field_or_struct.MemberEnd() || it->value.IsNull()) {
+
+  auto metadata_result = field_or_struct["metadata"];
+  if (metadata_result.error() == simdjson::NO_SUCH_FIELD) {
     return metadata;
   }

Review Comment:
   These object field lookups should probably be revisited using the new 
helpers from https://github.com/apache/arrow/pull/50874



-- 
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]

Reply via email to