Copilot commented on code in PR #45998:
URL: https://github.com/apache/arrow/pull/45998#discussion_r3615333256


##########
cpp/src/arrow/filesystem/hdfs.h:
##########
@@ -52,12 +49,22 @@ struct ARROW_EXPORT HdfsOptions {
 
   static Result<HdfsOptions> FromUri(const ::arrow::util::Uri& uri);
   static Result<HdfsOptions> FromUri(const std::string& uri);
+
+  const std::string& host() const { return host_; }
+  int port() const { return port_; }
+  const std::string& user() const { return user_; }
+  const std::string& kerb_ticket() const { return kerb_ticket_; }
+  std::unordered_map<std::string, std::string> extra_conf() const { return 
extra_conf_; }

Review Comment:
   `HdfsOptions::extra_conf()` returns the `unordered_map` by value, which 
forces a copy on each call (e.g., `for (const auto& kv : 
options_.extra_conf())`). Returning a const reference would avoid needless 
allocations/copies and match the other accessors that return `const 
std::string&`.
   
   Note this will require updating the corresponding Cython declaration in 
`python/pyarrow/includes/libarrow_fs.pxd` to keep the C++/Cython signatures 
consistent.



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