Repository navigation
Conversation
wgtmac
force-pushed
the
metadata_table_api_refactor
branch
from
October 27, 2026 06:00
a0fb6c8 to
346d3b7
Compare
manuzhang
reviewed
Oct 27, 2026
manuzhang
reviewed
Oct 27, 2026
manuzhang
reviewed
Oct 27, 2026
manuzhang
reviewed
Oct 27, 2026
manuzhang
reviewed
Oct 27, 2026
manuzhang
reviewed
Oct 27, 2026
zhjwpku
reviewed
Oct 27, 2026
manuzhang
added a commit
to manuzhang/iceberg-cpp
that referenced
this pull request
Oct 28, 2026
Make the scan surface a subset of the API proposed in apache#1066 so the two can converge: - MetadataTable::NewScan() is virtual and const, and ScanProjection() is const. - MetadataScanBuilder::Select() resolves names immediately with the current CaseSensitive() setting and records errors for Build(); Project() sets the output schema directly, and Build() rejects a null projection. - MetadataScan::ToArrowArrayStream() is virtual and const. - Projection validation rejects unknown columns, type changes, and projecting a nullable column as required, with the same messages as apache#1066. - Drop the time-travel options together with TimeTravelMetadataTable and SnapshotSelection, which apache#1066 also removes; nothing on main implements them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
manuzhang
added a commit
to manuzhang/iceberg-cpp
that referenced
this pull request
Oct 28, 2026
…Build() Drop the MetadataScan class: separating a built scan from the Arrow stream it reads belongs to the task-based design in apache#1066. Build() now validates the options and returns the stream directly, and each call returns a new stream. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
shangxinli
reviewed
Oct 28, 2026
shangxinli
reviewed
Oct 28, 2026
shangxinli
reviewed
Oct 28, 2026
WZhuo
reviewed
Oct 29, 2026
WZhuo
reviewed
Oct 29, 2026
wgtmac
force-pushed
the
metadata_table_api_refactor
branch
from
October 30, 2026 15:05
346d3b7 to
af6e0e0
Compare
wgtmac
force-pushed
the
metadata_table_api_refactor
branch
from
October 30, 2026 15:30
af6e0e0 to
c8220da
Compare
manuzhang
approved these changes
Oct 30, 2026
- Add Table::Inspect() and task-based metadata scans while retaining column selection, projection, case sensitivity, and time-travel builder configuration from the merged inspection API. - Separate task planning from reading with reusable static tasks backed by captured table metadata. - Preserve scan configuration and metadata across builder changes and table refreshes. - Produce Arrow batches lazily through MetadataScanTaskReader, with reader-controlled batch sizes and independent stream lifetimes. - Keep canonical schemas and row conversion in each metadata table implementation, sharing batch construction and projection validation. - Consolidate projected-column append helpers with lazy batch construction. - Preserve all merged metadata inspection test scenarios and cover planned projections, task reuse, stream lifetimes, batching, and vector<bool>.
wgtmac
force-pushed
the
metadata_table_api_refactor
branch
from
October 30, 2026 15:51
c8220da to
8b60bf1
Compare
zhjwpku
approved these changes
Oct 31, 2026
manuzhang
reviewed
Nov 1, 2026
| // Walk the current snapshot's ancestry; the insert check stops on cycles. | ||
| std::unordered_set<int64_t> ancestors; | ||
| for (auto current = metadata->current_snapshot_id; | ||
| current != kInvalidSnapshotId && ancestors.insert(current).second;) { |
Member
There was a problem hiding this comment.
the current snapshot might not exist
Member
Author
There was a problem hiding this comment.
Good catch! Now I validate every snapshot and stop when anything is wrong.
manuzhang
reviewed
Nov 1, 2026
| if (next_task_ == tasks_.size()) { | ||
| return std::nullopt; | ||
| } | ||
| ICEBERG_ASSIGN_OR_RAISE(current_, reader_->Open(*tasks_[next_task_++])); |
Member
There was a problem hiding this comment.
could tasks contain null pointer?
Member
Author
There was a problem hiding this comment.
It is unlikely but does not hurt to add a safety check.
wgtmac
force-pushed
the
metadata_table_api_refactor
branch
from
November 1, 2026 15:26
8b60bf1 to
53629e2
Compare
wgtmac
force-pushed
the
metadata_table_api_refactor
branch
from
November 1, 2026 15:30
53629e2 to
8b60bf1
Compare
manuzhang
reviewed
Nov 1, 2026
| std::make_shared<MockCatalog>())); | ||
| } | ||
|
|
||
| static Result<ArrowArrayStream> BuildStream(MetadataScanBuilder& builder) { |
Member
There was a problem hiding this comment.
This is the same as that in the base class.
Member
Author
There was a problem hiding this comment.
This is an oversight from my side.
WZhuo
approved these changes
Nov 2, 2026
blackmwk
approved these changes
Nov 2, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Other Iceberg implementations
TableScanconfiguration where applicable. Static tables materialize rows intoStaticDataTask; other tables use tasks that read manifests or manifest lists. Metadata tasks participate in the file-scan task hierarchy and have JSON parsers.Table.Inspect()exposes methods for individual metadata tables and returns Arrow record readers. Snapshots and history are materialized into a single batch.table.inspect()exposes typed metadata-table objects with schemas and an asyncscan()returning an Arrow record-batch stream. The inspected snapshots, history, and manifests implementations build a batch before wrapping it in a stream.table.inspectexposes methods returning materialized PyArrow tables. Some manifest/file inspection paths use an executor to parallelize reads before collecting the results.Design decisions
ToArrowArrayStream()path. The builder selects output columns; the reader controls execution settings.TableScanBuilderand inherit from the ordinary data-file task hierarchyStructLikevalues or table-specific structs in a central variantTableMetadatafor snapshots/history tasksMetadataScanTaskReader::Options.