Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ arrow-data = { workspace = true, optional = true }
arrow-schema = { workspace = true, optional = true }
arrow-select = { workspace = true, optional = true }
arrow-ipc = { workspace = true, optional = true }
object_store = { version = "0.11.0", default-features = false, optional = true }
object_store = { version = "0.12.0", default-features = false, optional = true }

bytes = { version = "1.1", default-features = false, features = ["std"] }
thrift = { version = "0.17", default-features = false }
Expand Down Expand Up @@ -86,7 +86,7 @@ serde_json = { version = "1.0", features = ["std"], default-features = false }
arrow = { workspace = true, features = ["ipc", "test_utils", "prettyprint", "json"] }
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread", "io-util", "fs"] }
rand = { version = "0.9", default-features = false, features = ["std", "std_rng", "thread_rng"] }
object_store = { version = "0.11.0", default-features = false, features = ["azure"] }
object_store = { version = "0.12.0", default-features = false, features = ["azure", "fs"] }

[package.metadata.docs.rs]
all-features = true
Expand Down
9 changes: 7 additions & 2 deletions parquet/src/arrow/async_reader/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,18 @@ impl ParquetObjectReader {

impl AsyncFileReader for ParquetObjectReader {
fn get_bytes(&mut self, range: Range<usize>) -> BoxFuture<'_, Result<Bytes>> {
let range = range.start as u64..range.end as u64;
self.spawn(|store, path| store.get_range(path, range))
}

fn get_byte_ranges(&mut self, ranges: Vec<Range<usize>>) -> BoxFuture<'_, Result<Vec<Bytes>>>
where
Self: Send,
{
let ranges = ranges
.into_iter()
.map(|range| range.start as u64..range.end as u64)
.collect::<Vec<_>>();
self.spawn(|store, path| async move { store.get_ranges(path, &ranges).await }.boxed())
}

Expand All @@ -165,7 +170,7 @@ impl AsyncFileReader for ParquetObjectReader {
// `Self::get_bytes`.
fn get_metadata(&mut self) -> BoxFuture<'_, Result<Arc<ParquetMetaData>>> {
Box::pin(async move {
let file_size = self.meta.size;
let file_size = self.meta.size.try_into().expect("overflow");
let metadata = ParquetMetaDataReader::new()
.with_column_indexes(self.preload_column_index)
.with_offset_indexes(self.preload_offset_index)
Expand All @@ -181,7 +186,7 @@ impl AsyncFileReader for ParquetObjectReader {
options: &'a ArrowReaderOptions,
) -> BoxFuture<'a, Result<Arc<ParquetMetaData>>> {
Box::pin(async move {
let file_size = self.meta.size;
let file_size = self.meta.size.try_into().expect("overflow");
let metadata = ParquetMetaDataReader::new()
.with_column_indexes(self.preload_column_index)
.with_offset_indexes(self.preload_offset_index)
Expand Down
Loading