Skip to content

Complete Java-compatible schema evolution for native reads - #1128

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

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

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Paired Python integration: apache/paimon#10572 (draft until this core change is merged).

Complete the Native read paths for schema changes PyPaimon already supports, using Java's SchemaEvolutionUtil and scalar cast rules. The read path still used generic Arrow casts for several conversions even though the Java-compatible executors already existed in core.

Changes

  • Reuse the core Java scalar executors for lexical parsing, numeric strings, and character/binary widths; reject invalid text instead of silently producing NULL.
  • Handle INTEGER timestamp casts, signed-long timestamp precision truncation, Java type aliases/default parameters, and equivalent Decimal256 physical storage.
  • Reconcile LargeList and other existing ARRAY layouts recursively while preserving historical field IDs. Convert only visible elements, excluding sliced backing values and children of NULL ROW/ARRAY/MAP containers.
  • Normalize selected MAP string keys and fresh/already assembled VARIANT projections into the read layout.
  • Use a consistent runtime Arrow read schema so Java cast-produced NULLs remain representable for logical NOT NULL fields. Persisted table constraints and canonical writer schemas remain unchanged.
  • Expose thin Python Arrow transport functions for schema casts/read schemas and the existing writer normalization. Read-to-write normalization validates actual visible NOT NULL values in core.

Verification

  • Core library: 4,045 passed, 6 ignored.
  • Actual-Java scalar fixture reused through the production schema-evolution entry point: 1,562 cases in each of UTC, Asia/Shanghai and America/New_York.
  • Nested, decimal and predicate schema-evolution integration tests: 4 passed across append, PK and data-evolution modes.
  • DataFusion self-contained library tests: 368 passed. Seven existing tests requiring external pre-populated warehouse tables were excluded locally after confirming those tables were absent.
  • Rust 1.98.0 formatting and Clippy (paimon, paimon-datafusion, Python binding; library/tests) passed.
  • Paired PyPaimon Native acceptance suite: 639 passed, 2 skipped, including read-to-write constraints and NULL containers. Additional Python fallback regressions: 244 passed, 1 skipped.

The Java fixture comparisons exclude outputs outside Arrow's physical representation and malformed UTF-8; their existing explicit storage/error behavior remains covered separately. No new table formats or Python-unsupported features are introduced.

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

Reviewed the schema-evolution implementation, Python bridge, DataFusion nullability changes, and the affected Rust tests. No blocking issues found. The full PR check suite is green, including unit, integration, and Windows/macOS builds.

@JingsongLi
JingsongLi merged commit 95d0e11 into apache:main Oct 15, 2026
16 checks 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