Skip to content

Commit 3875931

Browse files
committed
Address comments from #822
1 parent 6e64d88 commit 3875931

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

crates/iceberg/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mod avro;
7373
pub mod io;
7474
pub mod spec;
7575

76-
pub mod metadata_scan;
76+
pub mod metadata_table;
7777
pub mod scan;
7878

7979
pub mod expr;

crates/iceberg/src/metadata_scan.rs renamed to crates/iceberg/src/metadata_table.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,27 @@ use crate::Result;
3838
/// - <https://iceberg.apache.org/docs/latest/spark-queries/#querying-with-sql>
3939
/// - <https://py.iceberg.apache.org/api/#inspecting-tables>
4040
#[derive(Debug)]
41-
pub struct MetadataTable(Table);
41+
pub struct MetadataTable<'a>(&'a Table);
4242

43-
impl MetadataTable {
43+
impl<'a> MetadataTable<'a> {
4444
/// Creates a new metadata scan.
45-
pub(super) fn new(table: Table) -> Self {
45+
pub(super) fn new(table: &'a Table) -> Self {
4646
Self(table)
4747
}
4848

4949
/// Get the history table.
5050
pub fn history(&self) -> HistoryTable {
51-
HistoryTable { table: &self.0 }
51+
HistoryTable { table: self.0 }
5252
}
5353

5454
/// Get the snapshots table.
5555
pub fn snapshots(&self) -> SnapshotsTable {
56-
SnapshotsTable { table: &self.0 }
56+
SnapshotsTable { table: self.0 }
5757
}
5858

5959
/// Get the manifests table.
6060
pub fn manifests(&self) -> ManifestsTable {
61-
ManifestsTable { table: &self.0 }
61+
ManifestsTable { table: self.0 }
6262
}
6363
}
6464

@@ -591,7 +591,7 @@ mod tests {
591591
partition_summaries: ListArray
592592
[
593593
StructArray
594-
-- validity:
594+
-- validity:
595595
[
596596
valid,
597597
]

crates/iceberg/src/table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::sync::Arc;
2222
use crate::arrow::ArrowReaderBuilder;
2323
use crate::io::object_cache::ObjectCache;
2424
use crate::io::FileIO;
25-
use crate::metadata_scan::MetadataTable;
25+
use crate::metadata_table::MetadataTable;
2626
use crate::scan::TableScanBuilder;
2727
use crate::spec::{TableMetadata, TableMetadataRef};
2828
use crate::{Error, ErrorKind, Result, TableIdent};
@@ -203,7 +203,7 @@ impl Table {
203203

204204
/// Creates a metadata table which provides table-like APIs for inspecting metadata.
205205
/// See [`MetadataTable`] for more details.
206-
pub fn metadata_table(self) -> MetadataTable {
206+
pub fn metadata_table(&self) -> MetadataTable<'_> {
207207
MetadataTable::new(self)
208208
}
209209

0 commit comments

Comments
 (0)