felipecrv commented on code in PR #36418:
URL: https://github.com/apache/arrow/pull/36418#discussion_r1248320694


##########
cpp/src/arrow/array/array_nested.cc:
##########
@@ -611,9 +611,10 @@ const std::shared_ptr<Array>& StructArray::field(int i) 
const {
   return boxed_fields_[i];
 }
 
-std::shared_ptr<Array> StructArray::GetFieldByName(const std::string& name) 
const {
+const std::shared_ptr<Array>& StructArray::GetFieldByName(const std::string& 
name) const {
+  static std::shared_ptr<Array> null;

Review Comment:
   Having to add a static like this might be reason enough to continue 
returning a value instead of a `&`.



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