Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eebab02697
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
eebab02 to
731da1f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 731da1f56a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e5a8a09 to
0db25f4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0db25f4323
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Metadata tables are now read through a scan. MetadataTable::NewScan() returns a builder that selects columns and, for tables that support time travel, a snapshot. The built scan plans DataTasks whose rows are StructLike rather than Arrow arrays. ReadDataTasks() converts the rows of any data task to an ArrowArrayStream, and ReadMetadataTable() reads a whole metadata table scan that way. MetadataTable::Scan() and kBatchSize are removed, so the metadata table interface no longer uses Arrow types. SnapshotsTable moves to the new interface, and HistoryTable gains a scan that returns one row per snapshot log entry. TimeTravelMetadataTable and SnapshotSelection are removed; a table that supports time travel overrides supports_time_travel() instead. example/metadata_table_example.cc reads the snapshots table as Arrow batches and the history table as rows. Co-authored-by: Codex <codex@openai.com>
0db25f4 to
dff9ebd
Compare
What
DataTask, aScanTaskwhoseRows()returnsStructLikerows, andScanTask::Kind::kDataTask.ReadDataTasks()iniceberg/data_task_reader.h. It converts the rows of one or more data tasks to anArrowArrayStreamin batches of bounded size, including nested structs, lists, maps, decimals, and binary and fixed values.MetadataTable::NewScan(), which returns aMetadataTableScanBuilder(Select,CaseSensitive,UseSnapshot,UseRef,AsOfTime). The builder creates aMetadataTableScan, aTableScanwhosePlanFiles()returns data tasks. Each metadata table implements a privateMakeScan().ReadMetadataTable()iniceberg/inspect/metadata_table_reader.h. It plans a metadata table scan and reads all of its rows as oneArrowArrayStream, so a read isNewScan()->Select(...).Build()followed by one call.StaticDataTaskfor rows held in memory. It applies the scan's column selection, so tables have no projection code of their own.SnapshotsTableto the new interface. Its rows are views of eachSnapshot, and it no longer builds Arrow arrays.HistoryTablescans: one row per snapshot log entry withmade_current_at,snapshot_id,parent_id, andis_current_ancestor.TimeTravelMetadataTableandSnapshotSelection. A table that supports time travel overridessupports_time_travel().MetadataTable::Scan()andMetadataTable::kBatchSize, sometadata_table.hno longer uses Arrow types.example/metadata_table_example.cc, which reads the snapshots table as Arrow batches and the history table as rows.Why
MetadataTable::Scan()returned anArrowArrayStreamdirectly, so each metadata table built Arrow batches itself, and callers could not plan work, select columns, or read rows without Arrow (see the review discussion on apache#801). Splitting a scan into planningDataTasks, whose rows do not depend on any in-memory format, and converting those rows separately keeps the Arrow conversion in one place, gives every metadata table column and snapshot selection through one builder, and lets manifest-backed tables such as those in apache#876 plan one task per manifest that callers can read independently.Behavior change
MetadataTable::Scan()andMetadataTable::kBatchSizeare removed. Callers build a scan withNewScan()and read it withReadMetadataTable(), which returns the same rows in batches of at most 1024 rows by default.MakeScan()instead ofScan().TimeTravelMetadataTable,SnapshotSelection, andScan(const SnapshotSelection&)are removed. Snapshot selection goes throughNewScan(). Selecting a snapshot, a ref other thanmain, or a timestamp on a table that does not support time travel makesBuild()fail.HistoryTablescans return history rows instead ofNotSupported.NotSupported. No current metadata table has a struct column.Testing
metadata_table_testpasses (32 tests). The existingSnapshotsTabletests keep their expectations and now read through a test helper that builds a default scan and callsReadMetadataTable(). New tests cover:ReadDataTasks(): nested values and nulls, batches that span tasks, an empty task list, invalid arguments, null row streams, required-field nulls, mismatched scalar types (including nested fields), and rows that do not match the schema.StaticDataTask: selecting and reordering top-level columns, partial selection of a nested struct, and unknown fields.ReadMetadataTable().metadata_table_examplecompiles in C++23 with only the public include directories. Run onsrc/iceberg/test/resources/TableMetadataV2Valid.json, it prints 2 snapshots and both history entries.🤖 Generated with Claude Code