Skip to content

[Python] Align selected write nullability with Java and Native - #10666

Merged
JingsongLi merged 2 commits into
apache:masterfrom
JingsongLi:codex/native-io-path-completion
Oct 19, 2026
Merged

JingsongLi merged 2 commits into
apache:masterfrom
JingsongLi:codex/native-io-path-completion

Conversation

@JingsongLi

@JingsongLi JingsongLi commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Complete the remaining verified Native write/update nullability gaps for existing PyPaimon APIs, using current Java semantics.

Depends on apache/paimon-rust#1179. Native CI continues building Rust main; keep this PR draft until the Core fixes land.

Changes

  • Match Java's separate nullable KV value type for non-cross-partition deduplicate tables. Valid DELETE records can omit non-key/non-sequence NOT NULL values without changing the logical schema.
  • Apply logical row-kind-specific NULL checks before optional filtering on Arrow and InternalRow writes. Preserve strict INSERT/UPDATE and other-engine/cross-partition rules.
  • Use the physical value schema for Arrow/Pandas transport and Parquet system-field output, preserving keys, sequence fields, nested constraints and metadata.
  • Validate actual selected row-ID update output against its declared NOT NULL fields, after matching/deduplication/merging, and restore physical root field flags without casting hidden children.
  • Apply the same target constraint to dedicated BLOB output, which bypasses the ordinary Arrow writer. Nullable Blob values and NULL children of non-NULL containers remain valid.
  • Add batch/stream Native regressions for upsert/MERGE source NULLs that Core must discard, backed by the companion Rust transport fix. Python Native APIs remain thin wrappers.

Verification

  • Review follow-up: chunked MERGE source regression covers batch/stream execution and NULL chunks in either order, NULL keys, unmatched NULL payloads, and dictionary values that decode to NULL. Final source-nullability suite: 25 passed, 25 Native skipped locally; Flake8 and Python 3.6 syntax pass. The companion Rust binding suite executes the real Core MERGE path without installing a Python extension.

  • New retained-delete and adjacent writer regressions: 237 passed, 121 skipped locally. Actual commits/readback, sequence ordering, physical schema, required fields and existing writer APIs remain covered.

  • New update-source and target-nullability matrix: 21 passed, 21 Native skipped. Covers Arrow/GenericRow upserts, MERGE, unused source columns, discarded duplicates, selected invalid NULLs, nullable targets, dedicated Blob and Blob collection children.

  • Final combined update/upsert/MERGE/chunked writer suite: 281 passed, 21 Native skipped, 44 subtests passed. Includes restoration of NOT NULL physical root fields and the existing RecordBatch columns protocol.

  • Final changed Python files pass repository Flake8, Python 3.6 syntax parsing and diff checks.

  • Java's existing deduplicate-DELETE/sequence reference tests: 2 passed.

  • Companion Rust retained-delete and filtered-write suites, 104 Python-binding Rust tests, 4319 core library tests (7 ignored), Rust 1.98.0 all-target Clippy and rustfmt.

  • Reproductions first fail on the old implementation, then pass. Local Python tests did not rebuild or install the Native extension; Native cases remain enabled for CI after the Rust fix lands.

No new dependency, public API, extension-version fallback or implicit commit-message deletion is added.

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

LGTM

@JingsongLi
JingsongLi marked this pull request as ready for review October 19, 2026 15:00
@JingsongLi
JingsongLi merged commit 3357c6f into apache:master Oct 19, 2026
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