Skip to content

Commit

Permalink
[doc] improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Sep 24, 2021
1 parent ec24a3b commit 2ef3233
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions datafusion/src/datasource/object_store/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ impl ObjectReader for LocalFileReader {
start: u64,
length: usize,
) -> Result<Box<dyn Read + 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)))
Expand Down
6 changes: 3 additions & 3 deletions datafusion/src/datasource/object_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use local::LocalFileSystem;

use crate::error::{DataFusionError, Result};

/**
Object Reader for one file in an object store
*/
/// Object Reader for one file in an object store
/// Note that the dynamic dispatch on the reader might
/// have some performance impacts.
#[async_trait]
pub trait ObjectReader {
/// Get reader for a part [start, start + length] in the file
Expand Down

0 comments on commit 2ef3233

Please sign in to comment.