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


##########
cpp/src/arrow/csv/parser_test.cc:
##########
@@ -376,6 +383,19 @@ TEST(BlockParser, TruncatedData) {
   }
 }
 
+TEST(BlockParser, TruncatedDataViews) {
+  // If non-last block is truncated, parsing stops
+  BlockParser parser(ParseOptions::Defaults(), /*num_cols=*/3);
+  AssertParsePartial(parser, Views({"a,b,", "c\n"}), 0);
+  // (XXX should we guarantee this one below?)

Review Comment:
   Ok, so the problem is that it makes harder to return a meaningful error 
message. The CSV parser itself has no idea of who did the chunking and how, so 
it can't start mentioning `newlines_in_values`. It would have to return a more 
generic `Status::Invalid`, then the CSV would have to detect that particular 
`Status::Invalid` (how?) and rewrite the error message.
   
   This is a lot of complication for a bit of unnecessary purity in the 
`BlockParser` API (which isn't terribly pretty to begin with), so I would 
rather keep the current solution in the PR.



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