taepper commented on code in PR #51108:
URL: https://github.com/apache/arrow/pull/51108#discussion_r4345145476


##########
cpp/src/arrow/json/parser.cc:
##########
@@ -966,7 +972,7 @@ class ParseImpl : public BlockParser {
       if (ARROW_PREDICT_FALSE(!field_builder.nullable)) {
         return ParseError("a required field was absent");
       }

Review Comment:
   We could use
   
   ```
   if 
(ARROW_PREDICT_FALSE(!Cast<Kind::kObject>(parent)->field_builder(i).nullable)) {
     return ParseError("a required field was absent");
   }
   ```
   
   to avoid the variable `field_builder`



##########
cpp/src/arrow/json/parser.cc:
##########
@@ -669,7 +673,9 @@ class ParseImpl : public BlockParser {
 
   Status Null() {
     DCHECK(!builder_stack_.empty());
-    return builder_set_.AppendNull(builder_stack_.back(), field_index_, 
builder_);
+    ARROW_ASSIGN_OR_RAISE(builder_,
+                          builder_set_.AppendNull(builder_stack_.back(), 
field_index_));
+    return Status::OK();

Review Comment:
   I like this a lot! :)



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