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


##########
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:
   Perhaps we can simply change the message "Unknown JSON type" to something 
more meaningful?



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