← Back to Pull requests

[core] Normalize Arrow layouts for upserts and data evolution updates #1144

Closed
unknown closed this pull request without merging on Oct 17, 2026 08:35 UTC
View on GitHub
unknown unknown commented on Oct 17, 2026 05:57 UTC
Author

Purpose

Keep PyPaimon's existing large-string upserts on Native execution, including strings used as match keys, partition fields and nested values. PyPaimon currently falls back because core write normalization rejects LargeUtf8 for the canonical Utf8 STRING representation.

PyPaimon integration: apache/paimon#10624. Its Native CI continues to build Rust main and requires this change first.

Testing this path also exposes a DE update failure for ROW/ARRAY/MAP types with required children: runtime read schemas relax nested nullability, while the partial-file writer uses the declared table schema. Interleaving against the runtime schema leaves incompatible child types in the output.

Brief change log

  • Normalize LargeUtf8 to Utf8 in the existing core write normalizer. This is an Arrow layout conversion for Java/Paimon's STRING values, with checked offset bounds; it does not introduce implicit numeric or binary casts.

  • Reuse recursive normalization for nested strings and for the key encoding performed by core upserts.

  • Normalize merged DE update values back to their declared write layout before constructing partial-column batches. Preserve NULL parents while validating visible required children.

  • Add a core upsert round trip covering multiple batches, duplicate and NULL keys, updates to multiple target rows, absent columns on append, and stable row IDs.

  • Cover sliced strings, Unicode, empty values, nested layouts and visible versus hidden NULL children.
  • Tests

  • cargo +1.98.0 test --quiet --locked -p paimon --lib: 4151 passed, 6 ignored.

  • cargo +1.98.0 clippy --quiet --locked -p paimon --lib --tests -- -D warnings.

  • cargo +1.98.0 fmt --all --check.

  • Built Python bindings and verified the corresponding PyPaimon execution paths: 30 new Native/Python parity cases passed; the related DE/update/BLOB regression selection passed 568 tests with 2 skips.

  • Independent review of input eligibility, nested constraints and failure paths.
  • API and Format

    No new public interfaces, options, dependencies or storage formats. Java STRING values and the existing declared write constraints remain authoritative.

    Documentation

    No documentation changes are required.

    Diff: 278 lines (+208 / -70) across 3 files Reviewer: JeonDaehong Review duration: 157m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 278 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.337
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1144"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.6% (MEDIUM) · Higher = larger blast radius
    39.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.1% · Safe to merge
    17.1%