Skip to content

fix(iceberg): normalize typed refs before scan planning - #30548

Merged
mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/5b85e397f967b77a07476c321b44971d4dca3aaab353a63f7559f6d604a5f45e
Oct 20, 2026
Merged

mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/5b85e397f967b77a07476c321b44971d4dca3aaab353a63f7559f6d604a5f45e

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

What this PR does / why we need it:

Iceberg mappings with ref='branch:main' can write but fail to read, while ref='snapshot:<id>' is incorrectly routed as a Nessie catalog ref and loses its snapshot pin. Interpret typed refs once before credentials and scan planning: typed main uses main semantics, snapshot refs use the existing explicit snapshot selector, and explicit SQL time travel keeps precedence.

Preserve caller-provided prefixes, existing Nessie branch/tag/detached-hash routing, display refs, and pinned-write rejection. Add protocol/selector/cache/schema/error regressions and a MySQL frontend regression that uses native metadata, Parquet reads, and append coordination with injected catalog/object storage.

Validation:

  • Complete pkg/iceberg/metadata package tests (161 top-level passes); source and production dependencies remain unchanged at the integrated head.
  • Complete pkg/embed package tests at cad50df7da0c (131 top-level passes); the full Iceberg SQL group was revalidated at b1b189aafc59 after upstream bootstrap integration (3 top-level passes, including all native typed-ref scenarios).
  • MySQL frontend regression: main/typed-main row equivalence, old snapshot rows, explicit overrides, append visibility, and pinned-write rejection.
  • Changed-package go vet and incremental golangci-lint on the integrated head (0 issues), formatting, and diff checks.
  • Baseline production-source overlay: all three bare-main controls pass; all six typed-ref cases fail for the expected semantics.

Live Nessie/MinIO execution is not included in the local evidence; catalog request boundaries and real SQL/native execution are covered separately. CI has not been accepted as part of local validation. Leave both issues open for reporter verification after merge.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: 7a8de9e26303c4483545e3fb6263731201324223

Review completed. Read the assessment.

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 7a8de9e26303c4483545e3fb6263731201324223

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-xupeng · review

Commit: 7a8de9e26303c4483545e3fb6263731201324223

Assessment: approve

Reviewed the complete five-file delta and surrounding SQL, catalog, snapshot, schema, cache and resource-lifecycle owners. Ref normalization reuses the existing parser and preserves selector precedence and routing compatibility. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

Validation:

  • Isolation preflight, repository-owned native build and native provenance verification passed.

  • Full pkg/iceberg/metadata suite passed: 161 top-level tests, no failures or skips. Receipt: checks/1792466252733643760-3.json; log: metadata-tests.log.

  • Embedded SQL harness passed all 10 scenarios, including typed refs, snapshot overrides, append visibility and pinned-write rejection. Receipt: checks/1792466683185065407-3.json; log: embedded-sql-tests.log.

  • Baseline overlay control reproduced six typed-ref failures while three bare-main controls passed. This expected baseline failure demonstrates regression coverage. Receipt: checks/1792466281975871394-5.json; log: baseline-control.log.

  • Commands, source fingerprints, exit receipts and retained logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/5b9aef48863aa79dd3fe2026/attempt-1/validation-audit.json. Final source audit confirmed the assigned checkout remained unchanged.

Limitations:

  • The embedded harness uses injected catalog and object storage; no live Nessie/MinIO deployment was exercised.

  • Frozen local_validation was empty; author assertions and CI status were not counted as executed validation.

  • Linked issue bodies were absent from frozen evidence; review assessed the PR's documented behavioral contracts.

  • Unrelated embed tests and whole-repository suites were not rerun.

@mergify mergify Bot added the queued label Oct 20, 2026
@mergify

mergify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-20 03:25 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-20 05:26 UTC · at 3829ee49c7c118f2f3b0ebf7ed3acbd52483d870 · squash

This pull request spent 2 hours 34 seconds in the queue, including 50 minutes 39 seconds running CI.

Required conditions to merge

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 7a8de9e26303c4483545e3fb6263731201324223

Assessment: approve

Reviewed the complete five-file delta and affected SQL, catalog, cache, and write paths. Normalizing typed refs in the existing runtime planner reuses the shared parser and restores read semantics without duplicating selection logic. Explicit time-travel precedence, catalog prefixes, snapshot isolation, display refs, and pinned-write rejection are preserved. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Full metadata package passed: 161 top-level tests. All 19 runtime-planner tests also passed with the race detector.

  • The complete embedded SQL harness passed all 10 scenarios normally and under the race detector, followed by two successful race repetitions. Coverage includes real frontend/native reads, explicit selector overrides, append visibility, stable snapshot pins, and rejected pinned writes.

  • A diagnostic overlay using the merge-base reader reproduced failures in all six typed-ref cases while all three bare-main controls passed.

  • Formatting, diff checks, go vet, molint, and configured incremental golangci-lint passed.

  • Native setup was recovered through retained repository-built artifacts after verifying 198 matching native inputs and 46 artifact hashes. The initial owner-probe failure occurred before tests.

  • Reconciled 14 command/source/exit receipts with retained logs and test outcomes. Evidence is recorded in /home/xupeng/.local/state/mo-bot/jobs/c553c2d7c259b8705d284501/attempt-1/review-evidence.json; the final reconciliation also passed. The source remains unchanged at the assigned head.

  • The new embedded scenario took 0.13 seconds in the normal run and reused the existing fixture. Production changes add ref parsing per Iceberg plan without another catalog round trip; snapshot history uses the existing explicit-selector path.

Limitations:

  • Live Nessie/MinIO was not exercised; catalog and object storage boundaries were injected while SQL compilation and native execution were real.

  • Linked issue bodies were absent from the frozen evidence; their behavioral contracts were assessed from the PR description and regressions.

  • Local embedded validation covered the complete affected harness, not the entire embed package. No throughput improvement is claimed from the noisy single-run timing comparison.

This branch was previously deployed

1 inactive deployment
ci — 4fa6fd59 Deployed Oct 20, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants