Dandandan commented on a change in pull request #1366:
URL: https://github.com/apache/arrow-datafusion/pull/1366#discussion_r757784452
##########
File path: datafusion/src/datasource/object_store/local.rs
##########
@@ -82,12 +82,15 @@ impl ObjectReader for LocalFileReader {
&self,
start: u64,
length: usize,
- ) -> Result<Box<dyn Read + Send + Sync>> {
+ ) -> Result<Box<dyn BufRead + Send + Sync>> {
// A new file descriptor is opened for each chunk reader.
// This okay because chunks are usually fairly large.
let mut file = File::open(&self.file.path)?;
file.seek(SeekFrom::Start(start))?;
- Ok(Box::new(file.take(length as u64)))
+
+ let file = BufReader::new(file.take(length as u64));
Review comment:
Yes - looks like `BufRead` wasn't needed :tada:
--
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]