Skip to content

fix(dataset): validate nested schema names and stored system columns - #9499

Merged
Xuanwo merged 8 commits into
mainfrom
gatekeeper/fix-9455-1
Oct 24, 2026
Merged

Xuanwo merged 8 commits into
mainfrom
gatekeeper/fix-9455-1

Conversation

@lance-gatefixer

@lance-gatefixer lance-gatefixer Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Schema::validate() checked duplicate names only at the root, so two children of the same struct could share a name. Selected writers checked reserved system-column names, allowing schema evolution and prewritten-fragment commits to store a top-level field that collides with a virtual column. The Issue also showed that writers accepted an empty top-level name even though field-path parsing cannot address it afterward.

Validate sibling names with a per-parent set throughout the schema. At the manifest write boundary, Schema::validate_writable() rejects all five reserved system names and empty names at the root. add_columns validates its output names before staging data because field-path resolution can run before the manifest check. Nested system names remain writable: virtual columns are injected only at the root, and previously written datasets can still change schema and restore.

A schema-changing commit rejects an existing top-level reserved or empty name. Datasets already written with an empty root name still need to be rewritten from their accessible columns.

Related draft #7854 covers newly introduced top-level reserved names; this repair also covers duplicate nested sibling names and the distributed commit path.

Validation

  • cargo test -p lance-core --lib validate_writable
  • cargo test -p lance-core --doc validate_writable
  • cargo test -p lance --lib rejects_unwritable_top_level_column_names
  • cargo test -p lance --lib test_append_columns_exprs
  • cargo test -p lance --lib test_rename_columns
  • cargo fmt --all
  • cargo clippy --all --tests --benches -- -D warnings

Fixes #9455

@github-actions github-actions Bot added the bug Something isn't working label Sep 23, 2026
@github-actions github-actions Bot added the A-encoding Encoding, IO, file reader/writer label Sep 23, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-changes Latest Gatekeeper recommendation requests changes. label Sep 23, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-changes Latest Gatekeeper recommendation requests changes. label Sep 23, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 25, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 25, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 29, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 29, 2026
Resolve the schema evolution test imports by retaining upstream array types and the repair's record_batch macro.
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 14, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 14, 2026
@lance-gatefixer

Copy link
Copy Markdown
Contributor Author

Blocked: the windows check fails while PyTorch reads a generated Inductor cache module, outside this schema-validation repair.

Head: 4f46e53572672ebfe6b77a863e8d54a87e995ee2 on gatekeeper/fix-9455-1. The failing context is windows (GitHub Actions app 15368), job 116073085085 in run 38628307499.

The wheel build passed. The test step reported 1 failure, 1788 passes, and 806 skips. test_torch_index_with_nans[Legacy] wrote its dataset successfully, then failed during Torch CPU centroid training with torch._inductor.exc.InductorError: PermissionError: [Errno 13] Permission denied while opening its generated cache module. This is a filesystem-access failure, not a schema-validation rejection.

I inspected the live check, annotations, complete job log, and repair diff. The test and Torch training/distance code are identical to current main (a12742aab70da12d59f8fd07957d0fc5df2537cb), which is already included in this head. This Linux environment cannot reproduce the Windows cache-access condition. No code or workflow changes were made, and no new head was pushed.

Smallest unblocking action: rerun the failed windows job on this same head with a fresh runner. If the permission failure recurs, investigate the Windows/PyTorch cache environment separately and provide a confirmed remedy; the FixAgent can then reassess the resulting evidence.

@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 22, 2026
@lance-gatefixer

Copy link
Copy Markdown
Contributor Author

Blocked: mac-build (stable) fails in an unchanged AWS credential test because macOS rejects the certificate used for S3 region discovery, outside this schema-validation repair.

Head: 2057bcfe7b7009d7b14df652b1347a721523e2d7 on gatekeeper/fix-9455-1. The failing context is mac-build (stable) (GitHub Actions app 15368), job 119961141447 in run 39817910140.

The test build passed. lance-io's test_injected_aws_creds_option_is_used then failed while constructing its S3 object store: region discovery returned InvalidCertificate with “certificate is not standards compliant: -67825”. The failure occurs before schema validation or dataset writes. Nextest reported 12,712 passes and this one failure, then stopped early.

I inspected the live check, annotations, job log, and relevant source. The AWS provider/test and lockfile are identical to current main (bdc01be84c62d68b832f3abbd97d422b6cba5dc3), already included in this head. A reproduction using macOS certificate validation is unavailable in this Linux environment. No code or workflow changes were made, and no new head was pushed.

Smallest next action: rerun the failed job on this same head with a fresh macOS runner to check whether the S3 TLS failure was transient. If it repeats, address the AWS test's external-network dependency separately, using an explicit region and a mock S3 endpoint, then resume this repair with that upstream fix.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 22, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 24, 2026

@lance-gatekeeper lance-gatekeeper Bot 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.

✅ Gate recommendation: approve.

The merge preserves recursive sibling-name validation and rejection of reserved or empty root names at manifest publication. Nested _rowid remains valid through schema changes and restore, and the new cleanup-aware fragment API still uses the guarded staging path.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 24, 2026
@lance-gatefixer

Copy link
Copy Markdown
Contributor Author

Blocked: the windows check fails when PyTorch Inductor opens a generated cache module, outside this schema-validation repair.

Head: bd750b78318aafe06d31cf3ad60a067ce6aa65be on gatekeeper/fix-9455-1. The failing context is windows (GitHub Actions app 15368), job 120741465796 in run 40050366008.

The Windows wheel build passed. The test step reported 1 failure, 1,844 passes, and 855 skips. test_torch_index_with_nans[V3] successfully wrote its dataset, then failed during Torch CPU centroid training: PyTorch's _reload_python_module raised torch._inductor.exc.InductorError: PermissionError: [Errno 13] Permission denied while opening its generated cache module. The failure is a cache-file access error rather than a schema-validation rejection.

I inspected the live check, annotations, complete job log, and repair diff. The failing test, Python indexing code, Torch training/distance code, and workflows are identical to current main (e438566d58ec7694c1c02f2bf8a83944cae68f45), which is already included in this head. This Linux environment cannot reproduce the Windows cache-access condition. No source changes or new push were warranted by this evidence.

Smallest unblocking action: rerun the failed windows job on this same head with a fresh runner. If the permission failure recurs, investigate the Windows/PyTorch cache access separately and provide a confirmed remedy or upstream fix so the FixAgent can reassess it without a speculative change to this repair.

@Xuanwo
Xuanwo merged commit 2643377 into main Oct 24, 2026
52 of 53 checks passed
@Xuanwo
Xuanwo deleted the gatekeeper/fix-9455-1 branch October 24, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: schema validation misses nested duplicate names and reserved system column names on several write paths

1 participant