Reranko05 commented on code in PR #51038:
URL: https://github.com/apache/arrow/pull/51038#discussion_r4083452213
##########
cpp/src/arrow/json/parser_test.cc:
##########
@@ -321,5 +321,15 @@ TEST(BlockParser, AdHoc) {
R"([{"c":true, "d": "1991-02-03"}, {"c":false, "d":"2019-04-01"}])"});
}
+TEST(BlockParserWithSchema, ValidateIgnoredFields) {
+ auto options = ParseOptions::Defaults();
+ options.explicit_schema = schema({field("known", int64())});
+ options.unexpected_field_behavior = UnexpectedFieldBehavior::Ignore;
+
+ std::shared_ptr<Array> parsed;
+ ASSERT_RAISES(Invalid,
+ ParseFromString(options, R"({"known": 1, "ignored": [1,]})",
&parsed));
Review Comment:
The current test reports `Unknown JSON type`. Would you prefer that we wrap
the error in the `Ignore` path with a more contextual message, or is testing
the current message sufficient?
--
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]