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


##########
cpp/src/arrow/json/chunker.cc:
##########
@@ -124,43 +86,77 @@ namespace {
 // and uses actual JSON parsing to delimit them.
 class ParsingBoundaryFinder : public BoundaryFinder {
  public:
-  Status FindFirst(string_view partial, string_view block, int64_t* out_pos) 
override {
-    auto length = ConsumeWholeObject(MultiStringStream({partial, block}));
-    if (length == string_view::npos) {
+  Status FindFirst(std::string_view partial, std::string_view block,
+                   int64_t* out_pos) override {
+    simdjson::padded_string input;
+
+    if (partial.empty()) {
+      input = simdjson::padded_string(block);
+    } else if (block.empty()) {
+      input = simdjson::padded_string(partial);
+    } else {
+      simdjson::padded_string_builder builder(partial.size() + block.size());
+      builder.append(partial);
+      builder.append(block);
+      input = builder.convert();
+    }
+
+    const std::string_view input_view(input.data(), input.size());
+    const size_t start = ConsumeWhitespace(input_view);
+    if (start < input_view.size() && input_view[start] != '{' &&
+        input_view[start] != '[') {
+      return Status::Invalid("JSON chunk error: invalid data at end of 
document");
+    }

Review Comment:
   Removed.



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