Skip to content

Commit 8c803d2

Browse files
committed
Address comments from #822
1 parent 64f1448 commit 8c803d2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

crates/iceberg/src/lib.rs

+1-1
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ use crate::Result;
3636
/// - <https://iceberg.apache.org/docs/latest/spark-queries/#querying-with-sql>
3737
/// - <https://py.iceberg.apache.org/api/#inspecting-tables>
3838
#[derive(Debug)]
39-
pub struct MetadataTable(Table);
39+
pub struct MetadataTable<'a>(&'a Table);
4040

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

@@ -65,7 +65,7 @@ impl MetadataTable {
6565

6666
/// Snapshots table.
6767
pub struct SnapshotsTable<'a> {
68-
metadata_table: &'a MetadataTable,
68+
metadata_table: &'a MetadataTable<'a>,
6969
}
7070

7171
impl<'a> SnapshotsTable<'a> {
@@ -147,7 +147,7 @@ impl<'a> SnapshotsTable<'a> {
147147
/// `is_current_ancestor` indicates whether the snapshot is an ancestor of the
148148
/// current snapshot. If `false`, then the snapshot was rolled back.
149149
pub struct HistoryTable<'a> {
150-
metadata_table: &'a MetadataTable,
150+
metadata_table: &'a MetadataTable<'a>,
151151
}
152152

153153
impl<'a> HistoryTable<'a> {

crates/iceberg/src/table.rs

+2-2
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)