Skip to content

fix(core): preserve literal field names in schema projection and intersection - #11301

Merged
Xuanwo merged 4 commits into
lance-format:mainfrom
AntiO2:fix/schema-literal-field-names
Dec 1, 2026
Merged

Xuanwo merged 4 commits into
lance-format:mainfrom
AntiO2:fix/schema-literal-field-names

Conversation

@AntiO2

@AntiO2 AntiO2 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #11305.

Preserve literal field names in schema projection, both intersections, and the shared Projection::from_schema entry point after #11445. User-supplied string paths retain their existing parsing behavior.

Rust and Python take regressions cover single and multiple fragments with repeated, out-of-order indices, checking values and types for a, `a`, a`b, and a real Int32 field named `_rowaddr`.

Validation on the rebased source:

  • Core schema tests: 88 passed; DataFusion projection tests: 17 passed; Rust take regressions: 2 passed.
  • Rebuilt Python extension: 35 take tests passed.
  • cargo fmt --all -- --check, cargo clippy --all --tests --benches -- -D warnings, uv run make lint, and pre-commit checks passed.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the bug Something isn't working label Nov 20, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 20, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Nov 20, 2026
@github-actions github-actions Bot added the A-python Python bindings label Nov 20, 2026
@lance-gatekeeper lance-gatekeeper Bot removed K-risk Latest Gatekeeper recommendation includes a non-blocking risk. K-approved Latest Gatekeeper recommendation permits acceptance. labels Nov 20, 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 Nov 20, 2026
Xuanwo
Xuanwo previously requested changes Nov 28, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

AI-assisted review of 9fe3baae

Please rebase onto main after #11445 and move the ProjectionPlan::from_schema fix to Projection::from_schema in rust/lance-core/src/datatypes/schema.rs. Schema-based Dataset::take and DataFusion now share that entry point. It still passes a field name from a structured schema to base_schema().field(name), which interprets backticks as path syntax. Keep the exact-name matches in project_by_schema and both intersections, and preserve path parsing for user-supplied strings.

On the rebased commit, please rerun the single- and multi-fragment take regressions with repeated, out-of-order indices. Include ordinary a beside a field whose name literally includes both backticks (`a`), a name with an embedded backtick, and a real Int32 field named `_rowaddr` including the backticks. Check the returned values and types so the latter stays distinct from the virtual _rowaddr.

The failures were reproduced on 14.0.3. The candidate was checked from source. Its earlier Rust and Python runs started zero jobs; the unchanged workflows are now authorized to run.

@AntiO2
AntiO2 force-pushed the fix/schema-literal-field-names branch from 9fe3baa to 59bbcaa Compare November 29, 2026 07:01
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 29, 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.

After the #11445 rebase, literal-name matching now lives in the shared Projection::from_schema constructor used by dataset takes and DataFusion. Takes preserve values, types, and repeated row order across fragments, including a stored backtick-wrapped _rowaddr column, while user-supplied path parsing remains intact.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 29, 2026
@Xuanwo
Xuanwo dismissed their stale review November 29, 2026 07:20

[AI-assisted review] 59bbcaae uses the shared Projection::from_schema from #11445. The CI wheel built from the same source tree passes the original take case and preserves reordered and repeated rows across fragments while distinguishing stored and virtual row-address fields. https://github.com/lance-format/lance/actions/runs/46236069611/job/141264558856

@AntiO2
AntiO2 requested a review from Xuanwo November 29, 2026 07:21
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Dec 1, 2026
@Xuanwo
Xuanwo merged commit f80e70d into lance-format:main Dec 1, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-python Python bindings bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: schema projection and intersection mishandle field names containing backticks

2 participants