Repository navigation
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
5 open issues
Whenroot_manifestis absent,ValidateForFormatVersionreturns success without validating the… · New This nullsmanifest_listbased onsnapshot.manifest_list.empty()rather than on whether the… · New These checks use direct JSON access and type-agnostic comparisons (`json[\"last-constraint-id\"] !=… · New Validate upgrade versions before narrowing to int8_t The precondition message is overly generic given the branching logic. Whenlocationis empty, the… · New
Review effort: Lite
ce26c99 to
60ecac1
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
9 open issues
This loop dereferencessnapshotunconditionally. Elsewhere in this PR (HasV4RootManifest)… · New ReturningNotSupportedfromFinalize()is risky because Finalize runs after the metadata update… · New Whenroot_manifestis absent,ValidateForFormatVersionreturns success without validating the…constraint-statusesis not type-validated. For malformed JSON (e.g., boolean/number/object), this… · New These checks use direct JSON access and type-agnostic comparisons (`json[\"last-constraint-id\"] !=… This nullsmanifest_listbased onsnapshot.manifest_list.empty()rather than on whether the… Validate upgrade versions before narrowing to int8_tType()allocates a newStructType(and vector) every call. These schema objects are typically… · New The precondition message is overly generic given the branching logic. Whenlocationis empty, the…
Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
11 open issues
ReturningNotSupportedfromFinalize()is risky because Finalize runs after the metadata update… This loop dereferencessnapshotunconditionally. Elsewhere in this PR (HasV4RootManifest)… Whenroot_manifestis absent,ValidateForFormatVersionreturns success without validating the… This still decodesformat-versionfor the upgrade action asint8_t, which narrows during JSON… · Newconstraint-statusesis not type-validated. For malformed JSON (e.g., boolean/number/object), this… These checks use direct JSON access and type-agnostic comparisons (`json[\"last-constraint-id\"] !=… This nullsmanifest_listbased onsnapshot.manifest_list.empty()rather than on whether the… Validate upgrade versions before narrowing to int8_t The new precondition error is actionable but doesn’t indicate how to resolve it. Consider expanding… · NewType()allocates a newStructType(and vector) every call. These schema objects are typically… The precondition message is overly generic given the branching logic. Whenlocationis empty, the…
Review effort: Lite
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain that require resolution before approval.
3 open issues
8 resolved since last review
ReturningNotSupportedfromFinalize()is risky because Finalize runs after the metadata update… This loop dereferencessnapshotunconditionally. Elsewhere in this PR (HasV4RootManifest)… Whenroot_manifestis absent,ValidateForFormatVersionreturns success without validating the…constraint-statusesis not type-validated. For malformed JSON (e.g., boolean/number/object), this… These checks use direct JSON access and type-agnostic comparisons (`json[\"last-constraint-id\"] !=… This nullsmanifest_listbased onsnapshot.manifest_list.empty()rather than on whether the…Type()allocates a newStructType(and vector) every call. These schema objects are typically… The precondition message is overly generic given the branching logic. Whenlocationis empty, the…
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because concurrent v4 root commits can invalidate planned metadata pruning, potentially removing a required spec despite the finalization guard.
2 open issues
1 resolved since last review
Review effort: Balanced
ca04e74 to
188c66a
Compare
6bdbc21 to
09c7a36
Compare
f490368 to
fa4aea8
Compare
fa4aea8 to
7237413
Compare
Support v4 table metadata creation, loading, upgrades, and JSON round trips with root-manifest snapshot references. Keep the default table version at 2 and preserve legacy snapshots. Require a provided absolute v4 table location. Validate v4 schemas and snapshots, expose roots in snapshot inspection, and guard expiration cleanup until root reachability checks are supported. Co-authored-by: Codex <[email protected]>
7237413 to
f2a328e
Compare
| const std::vector<std::unique_ptr<TableUpdate>>& updates, | ||
| auth::AuthSession& session) { | ||
| ICEBERG_ENDPOINT_CHECK(supported_endpoints_, Endpoint::UpdateTable()); | ||
| // The server may have roots absent from the client, including after an upgrade. |
There was a problem hiding this comment.
What is this block of code? How does this relate to v4 support?
There was a problem hiding this comment.
Looks like you are going to fail all versions including v1 to v3.
| summary.erase(SnapshotSummaryFields::kOperation); | ||
| return AppendStringMap(column, summary); | ||
| }}, | ||
| {.field_id = 9, .append = [](ArrowArray* column, const Snapshot& row) { |
There was a problem hiding this comment.
Why is this field_id 9 instead of 7?
| GetJsonValueOptional<std::string>(json, kManifestList)); | ||
| ICEBERG_ASSIGN_OR_RAISE(auto root_manifest, | ||
| GetJsonValueOptional<std::string>(json, kRootManifest)); | ||
| if (manifest_list.has_value() == root_manifest.has_value()) { |
There was a problem hiding this comment.
rewrite it into two error condition -
if (..has_value() && .. has_value()) and
if (!has_value() && !has_value())
and report separate errors. This way it's much easier to trouble shoot malformed json file.
| ICEBERG_ASSIGN_OR_RAISE(auto manifest_list, | ||
| GetJsonValue<std::string>(json, kManifestList)); | ||
| GetJsonValueOptional<std::string>(json, kManifestList)); | ||
| ICEBERG_ASSIGN_OR_RAISE(auto root_manifest, |
There was a problem hiding this comment.
should we only try to parse root_manifest when version is 4?
| Status Snapshot::ValidateForFormatVersion(int8_t format_version, | ||
| bool is_new_snapshot) const { | ||
| if (is_new_snapshot && format_version >= TableMetadata::kMinFormatVersionRootManifest) { | ||
| ICEBERG_CHECK(root_manifest.has_value(), |
There was a problem hiding this comment.
and check the manifest list doesn't set?
| ICEBERG_CHECK(format_version >= TableMetadata::kMinFormatVersionRootManifest, | ||
| "root-manifest requires format version {}", | ||
| TableMetadata::kMinFormatVersionRootManifest); | ||
| ICEBERG_CHECK(manifest_list.empty(), |
There was a problem hiding this comment.
Can we wrap these checks into a version awared validate function similar to #1169 ?
| }); | ||
| } | ||
|
|
||
| Status TableMetadata::ValidateLocation() const { |
There was a problem hiding this comment.
All these location validation need to account for relative path. Refer to #1124. Ok to resolve as a follow up but pls log an issue.
| } | ||
|
|
||
| // A create transaction may upgrade before selecting the current schema. | ||
| // Build() checks identifier-field compatibility across all schemas. |
There was a problem hiding this comment.
Build() checks identifier-field compatibility across all schemas.
but why the check below only checks against current schema? is it still going to fail at Build()?
| if (current_schema != schemas_by_id_.end() && | ||
| !current_schema->second->IdentifierFieldIds().empty()) { | ||
| return NotSupported( | ||
| "Cannot upgrade a table with identifier fields to format version {}: " |
There was a problem hiding this comment.
Can you add a link to v4 proposal/spec regarding this limitation? I am not aware and am curious why.
|
|
||
| Status TableMetadata::ValidateIdentifierFields() const { | ||
| if (format_version >= kMinFormatVersionConstraints && | ||
| std::ranges::any_of(schemas, [](const auto& schema) { |
There was a problem hiding this comment.
You check all schemas here instead of just current schema. This is inconsistent with UpgradeFormatVersion. So the upgrade could succeed but then Build() would fail. Need to fix this.



Depends on #1169 and #1172; merge those fixes first, then rebase onto main.
Adds
format-version: 4metadata creation, upgrades, and JSON round trips with absolute locations. The default remains 2. Supports root references and legacy snapshots, validates root snapshots, and protects expiration/pruning while root traversal is unavailable. REST schema/spec pruning remains deferred pending a server guarantee.Deferred: root-manifest I/O and writes, constraints migration, and relative paths. Separate PRs: #1160 manifest types; #1163 omitted locations.
Validation: table/JSON/catalog/REST/C++20/update suites, pre-commit, and clang-tidy.