Reranko05 commented on code in PR #50945:
URL: https://github.com/apache/arrow/pull/50945#discussion_r3896570878
##########
cpp/src/arrow/json/chunker_test.cc:
##########
@@ -264,12 +264,17 @@ TEST(ChunkerTest, Errors) {
std::string parts[] = {R"({"a":0})", "}", R"({"a":1})"};
auto chunker = MakeChunker(true);
std::shared_ptr<Buffer> whole, rest, completion;
+
ASSERT_OK(chunker->Process(Buffer::FromString(parts[0] + parts[1]), &whole,
&rest));
- ASSERT_EQ(std::string_view(*whole), parts[0]);
- ASSERT_EQ(std::string_view(*rest), parts[1]);
+
+ // simdjson rejects the malformed stream as a whole, so no complete chunk
+ // is emitted before the trailing invalid data.
+ ASSERT_TRUE(whole);
+ ASSERT_EQ(std::string_view(*whole), "");
+ ASSERT_EQ(std::string_view(*rest), parts[0] + parts[1]);
+
auto status =
chunker->ProcessWithPartial(rest, Buffer::FromString(parts[2]),
&completion, &rest);
- ASSERT_RAISES(Invalid, status);
Review Comment:
Added back. Removed by mistake.
--
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]