Skip to content

Commit 5cbad6e

Browse files
committed
chunker
1 parent bfee058 commit 5cbad6e

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

cpp/src/arrow/json/chunker.cc

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,9 @@ class ParsingBoundaryFinder : public BoundaryFinder {
167167

168168
while (consumed_length < block_length) {
169169
auto length = ConsumeWholeObject(block);
170-
if (length == string_view::npos) {
171-
const size_t start = ConsumeWhitespace(block);
172-
if (start < block.size() && block[start] != '{' && block[start] != '[') {
173-
return Status::Invalid("JSON parse error: Invalid value");
174-
}
175-
// found incomplete object
176-
break;
177-
}
178-
if (length == 0) {
179-
// Check if remaining block contains invalid content (not starting with { or [)
180-
const size_t start = ConsumeWhitespace(block);
181-
if (start < block.size() && block[start] != '{' && block[start] != '[') {
182-
return Status::Invalid("JSON parse error: Invalid value");
183-
}
184-
// found incomplete object or block is empty
170+
if (length == string_view::npos || length == 0) {
171+
// Incomplete or invalid document - stop here.
172+
// The remaining content is left as "partial" for later error handling.
185173
break;
186174
}
187175
consumed_length += length;

0 commit comments

Comments
 (0)