Skip to content

Commit e881f83

Browse files
committed
Make Storage a trait
1 parent 2ed0a6f commit e881f83

File tree

15 files changed

+1627
-312
lines changed

15 files changed

+1627
-312
lines changed

Cargo.lock

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ toml = "0.8"
127127
tracing = "0.1.41"
128128
tracing-subscriber = "0.3.20"
129129
typed-builder = "0.20"
130+
typetag = "0.2"
130131
url = "2.5.7"
131132
uuid = { version = "1.18", features = ["v7"] }
132133
volo = "0.10.6"

crates/iceberg/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ serde_with = { workspace = true }
8686
strum = { workspace = true, features = ["derive"] }
8787
tokio = { workspace = true, optional = false, features = ["sync"] }
8888
typed-builder = { workspace = true }
89+
typetag = { workspace = true }
8990
url = { workspace = true }
9091
uuid = { workspace = true }
9192
zstd = { workspace = true }

crates/iceberg/src/arrow/reader.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ impl ArrowReader {
447447
file_io: FileIO,
448448
should_load_page_index: bool,
449449
arrow_reader_options: Option<ArrowReaderOptions>,
450-
) -> Result<ParquetRecordBatchStreamBuilder<ArrowFileReader<impl FileRead + Sized>>> {
450+
) -> Result<ParquetRecordBatchStreamBuilder<ArrowFileReader>> {
451451
// Get the metadata for the Parquet file we need to read and build
452452
// a reader for the data within
453453
let parquet_file = file_io.new_input(data_file_path)?;
@@ -1646,18 +1646,18 @@ impl BoundPredicateVisitor for PredicateConverter<'_> {
16461646
}
16471647

16481648
/// ArrowFileReader is a wrapper around a FileRead that impls parquets AsyncFileReader.
1649-
pub struct ArrowFileReader<R: FileRead> {
1649+
pub struct ArrowFileReader {
16501650
meta: FileMetadata,
16511651
preload_column_index: bool,
16521652
preload_offset_index: bool,
16531653
preload_page_index: bool,
16541654
metadata_size_hint: Option<usize>,
1655-
r: R,
1655+
r: Box<dyn FileRead>,
16561656
}
16571657

1658-
impl<R: FileRead> ArrowFileReader<R> {
1658+
impl ArrowFileReader {
16591659
/// Create a new ArrowFileReader
1660-
pub fn new(meta: FileMetadata, r: R) -> Self {
1660+
pub fn new(meta: FileMetadata, r: Box<dyn FileRead>) -> Self {
16611661
Self {
16621662
meta,
16631663
preload_column_index: false,
@@ -1696,7 +1696,7 @@ impl<R: FileRead> ArrowFileReader<R> {
16961696
}
16971697
}
16981698

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

0 commit comments

Comments
 (0)