Skip to content

Commit a9d8fdf

Browse files
committed
Make Storage a trait
1 parent 3fe5030 commit a9d8fdf

File tree

12 files changed

+1327
-299
lines changed

12 files changed

+1327
-299
lines changed

crates/iceberg/src/arrow/reader.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl ArrowReader {
428428
file_io: FileIO,
429429
should_load_page_index: bool,
430430
arrow_reader_options: Option<ArrowReaderOptions>,
431-
) -> Result<ParquetRecordBatchStreamBuilder<ArrowFileReader<impl FileRead + Sized>>> {
431+
) -> Result<ParquetRecordBatchStreamBuilder<ArrowFileReader>> {
432432
// Get the metadata for the Parquet file we need to read and build
433433
// a reader for the data within
434434
let parquet_file = file_io.new_input(data_file_path)?;
@@ -1628,18 +1628,18 @@ impl BoundPredicateVisitor for PredicateConverter<'_> {
16281628
}
16291629

16301630
/// ArrowFileReader is a wrapper around a FileRead that impls parquets AsyncFileReader.
1631-
pub struct ArrowFileReader<R: FileRead> {
1631+
pub struct ArrowFileReader {
16321632
meta: FileMetadata,
16331633
preload_column_index: bool,
16341634
preload_offset_index: bool,
16351635
preload_page_index: bool,
16361636
metadata_size_hint: Option<usize>,
1637-
r: R,
1637+
r: Box<dyn FileRead>,
16381638
}
16391639

1640-
impl<R: FileRead> ArrowFileReader<R> {
1640+
impl ArrowFileReader {
16411641
/// Create a new ArrowFileReader
1642-
pub fn new(meta: FileMetadata, r: R) -> Self {
1642+
pub fn new(meta: FileMetadata, r: Box<dyn FileRead>) -> Self {
16431643
Self {
16441644
meta,
16451645
preload_column_index: false,
@@ -1678,7 +1678,7 @@ impl<R: FileRead> ArrowFileReader<R> {
16781678
}
16791679
}
16801680

1681-
impl<R: FileRead> AsyncFileReader for ArrowFileReader<R> {
1681+
impl AsyncFileReader for ArrowFileReader {
16821682
fn get_bytes(&mut self, range: Range<u64>) -> BoxFuture<'_, parquet::errors::Result<Bytes>> {
16831683
Box::pin(
16841684
self.r

0 commit comments

Comments
 (0)