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


##########
cpp/src/arrow/io/interfaces.h:
##########
@@ -279,24 +280,56 @@ class ARROW_EXPORT RandomAccessFile : public InputStream, 
public Seekable {
   ///
   /// \param[in] position Where to read bytes from
   /// \param[in] nbytes The number of bytes to read
+  /// \param[in] allow_short_read Whether to allow reading less than `nbytes`
+  /// \param[out] out The buffer to read bytes into
+  /// \return The number of bytes read, or an error
+  virtual Result<int64_t> ReadAt(int64_t position, int64_t nbytes, bool 
allow_short_read,
+                                 void* out);
+
+  /// \brief Read data from given file position.
+  ///
+  /// Like `ReadAt(position, nbytes, allow_short_read, out)` with 
`allow_short_read`
+  /// set to true.

Review Comment:
   By "these overloads", you mean those without the `allow_short_read` 
parameter, right?
   
   And, yes, I agree that disallowing short reads by default would definitely 
be safer. Short reads by default is fine in a "safe" language like Python, not 
so much in C++.
   



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