Skip to content

[python] Delegate schema evolution and runtime read schemas to Rust core - #10572

Merged
JingsongLi merged 2 commits into
apache:masterfrom
JingsongLi:codex/native-constructed-evolution
Oct 15, 2026
Merged

JingsongLi merged 2 commits into
apache:masterfrom
JingsongLi:codex/native-constructed-evolution

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Dependency

Requires apache/paimon-rust#1128. This PR is draft until the Rust changes are merged. Native CI continues to install Rust main; it is not pinned to a PR branch.

Purpose

Route Python's existing old-file/schema-evolution conversions through the same Rust core implementation as Native table readers, with Java semantics as the reference.

Changes

  • Delegate scalar and nested schema casts to the core Arrow transport API, including chunked/empty arrays and field-ID reconciliation.
  • Use the core runtime read schema for Native and Python read adapters. This permits Java cast-produced NULLs for logical NOT NULL fields without changing persisted constraints.
  • Preserve valid read-to-write roundtrips through the existing core writer normalizer. Actual visible forbidden NULL children are rejected. Python Parquet retains nullable transport fields for hidden NULL children underneath NULL ROW parents, after core validation.
  • Reject TIME precision changes Java cannot execute while accepting equivalent precision spellings.
  • Add REST append/PK/data-evolution regressions for constructed strings, LargeList layouts, scalar Java casts, type aliases/defaults, NOT NULL overflow and read-to-write constraints. Extend the non-UTC Native CI checks.

CAST parsing, numeric/temporal rules, nested visibility and writer value validation remain in Rust core; the Python changes transport types/arrays and integrate the returned schemas.

Verification

  • Native acceptance: 639 passed, 2 skipped, 16 subtests; 788 Native plans and 773 Native reads exercised, with guards preventing Python read fallback.
  • Existing Python/fallback regressions: 244 passed, 1 skipped, 13 subtests.
  • Native timestamp subset in separate Asia/Shanghai and America/New_York processes: 25 passed, 1 skipped in each zone.
  • Flake8, Apache license-header check and Python 3.6 grammar checks passed. Runtime tests used Python 3.13 with the paired editable Rust binding.
  • The paired Rust PR passed 4,045 core tests, 368 self-contained DataFusion tests, and the production evolution path's 1,562 actual-Java scalar cases per supported fixture zone.

The extreme millisecond timestamp case is covered directly and in append/data-evolution reads; its PK input test is skipped because the existing Python PK writer cannot materialize that out-of-datetime-range value.

@leaves12138 leaves12138 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.

Reviewed the Python-to-Rust schema-evolution delegation, runtime read schemas, nested constructed reads, and write-side nullability normalization. No blocking issues found. Targeted validation passed: 130 native schema-cast tests, 24 constructed-evolution tests, and 187 existing Python regression tests. The Native CI failure is the expected pre-merge dependency check because paimon-rust#1128 is not on paimon-rust main yet.

@JingsongLi
JingsongLi marked this pull request as ready for review October 15, 2026 02:17
@JingsongLi
JingsongLi force-pushed the codex/native-constructed-evolution branch from 82ef041 to 78bf10b Compare October 15, 2026 02:21
@JingsongLi
JingsongLi merged commit 4941e5d into apache:master Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants