Skip to content

refactor!: move the metadata table read into its data source - #119

Open
NoahKusaba wants to merge 1 commit into
apache:mainfrom
NoahKusaba:refactor/metadata-scan
Open

NoahKusaba wants to merge 1 commit into
apache:mainfrom
NoahKusaba:refactor/metadata-scan

Conversation

@NoahKusaba

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

N/A. Refactor.

Rationale for this change

IcebergMetadataTableProvider has a public inherent async fn scan(self) with the same name as TableProvider::scan but a different meaning: it consumes the provider and returns a stream of batches. Its only caller is IcebergMetadataDataSource::open, so reading rows is the data source's job, not part of the provider's public API.

What changes are included in this PR?

  • Removes IcebergMetadataTableProvider::scan(self).
  • Moves its body, unchanged, to a private read_all in metadata/scan.rs, next to its caller.

Are there any user-facing changes?

Yes, breaking: the public IcebergMetadataTableProvider::scan(self) is removed. Metadata tables are still queried through SQL (t$snapshots, ...) or TableProvider::scan, as before.

Are these changes tested?

Yes. $snapshots and $manifests were already read in tests; this adds reads_the_history_table, since $history was only listed, never read. It passes on main too.

@NoahKusaba
NoahKusaba force-pushed the refactor/metadata-scan branch from cd3f50f to dd7dd49 Compare November 19, 2026 12:51
IcebergMetadataTableProvider::scan(self) shared the name of
TableProvider::scan but consumed the provider and returned a stream. Its
only caller is IcebergMetadataDataSource::open, so the read is now a
private function next to it. Adds a test that reads $history, the one
metadata table no test read.
@NoahKusaba
NoahKusaba force-pushed the refactor/metadata-scan branch from dd7dd49 to f7dfb72 Compare November 19, 2026 12:54
@NoahKusaba
NoahKusaba marked this pull request as ready for review November 19, 2026 12:54
@NoahKusaba

Copy link
Copy Markdown
Contributor Author

@gabotechs this one is actually a small easy to read refactor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants