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


##########
cpp/src/arrow/integration/json_internal.cc:
##########
@@ -1407,21 +1442,28 @@ class ArrayReader {
 
     ARROW_ASSIGN_OR_RAISE(const auto json_data_arr, GetDataArray(obj_));
     ARROW_ASSIGN_OR_RAISE(const auto json_offsets, GetMemberArray(obj_, 
"OFFSET"));
-    if (static_cast<int32_t>(json_offsets.Size()) != (length_ + 1)) {
+    if (static_cast<int32_t>(json_offsets.size()) != (length_ + 1)) {
       return Status::Invalid(
           "JSON OFFSET array size differs from advertised array length + 1");
     }
 
     for (auto [i, is_valid, json_val] :
-         Zip(Enumerate<rj::SizeType>, is_valid_, json_data_arr)) {
+         Zip(Enumerate<size_t>, is_valid_, json_data_arr)) {
       if (!is_valid) {
         RETURN_NOT_OK(builder.AppendNull());
         continue;
       }
       ARROW_ASSIGN_OR_RAISE(auto val, GetStringView(json_val));
 
-      int64_t offset_start = ParseOffset(json_offsets[i]);
-      int64_t offset_end = ParseOffset(json_offsets[i + 1]);
+      ARROW_ASSIGN_OR_RAISE(auto offset_start_json,
+                            internal::ResolveSimdjsonResult(
+                                json_offsets.at(i), "Failed to get start 
offset"));
+      ARROW_ASSIGN_OR_RAISE(auto offset_end_json,
+                            internal::ResolveSimdjsonResult(json_offsets.at(i 
+ 1),
+                                                            "Failed to get end 
offset"));

Review Comment:
   Replaced the indexed `.at()` calls with an iterator over the offsets array.



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