Skip to content

[variant] Reuse residual validation across field extractions - #1496

Merged
JingsongLi merged 2 commits into
apache:mainfrom
XiaoHongbo-Hope:codex/reuse-variant-residual-validation
Nov 23, 2026
Merged

JingsongLi merged 2 commits into
apache:mainfrom
XiaoHongbo-Hope:codex/reuse-variant-residual-validation

Conversation

@XiaoHongbo-Hope

@XiaoHongbo-Hope XiaoHongbo-Hope commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Cold projections repeatedly validate the same wide Variant and copy its metadata for each field. This also occurs when Parquet prunes typed_value and the residual enters the ordinary Variant fallback.

Reuse a borrowed root across fallback projections and cache successful residual validation within each shredded row. Cast selected values directly instead of creating temporary owned Variants. Malformed-data checks and strict/try-cast behavior are preserved; whole-value reconstruction is unchanged. This complements #1166 and #1405.

On a fixed 1,344-row fixture with 16 cold float32 projections, 8 vCPU and three runs, planning + Arrow materialization fell from 7.750s to 1.186s (6.5x) with #1405 included in both arms. Full reads remained ~1.86s. The plain reference was 0.393s, so a residual gap remains. Logical-value checks passed; conversion/checking time is excluded.

Regression tests cover clipped layouts, casts, nulls, strict errors, distinct buffers and malformed residuals. cargo test --locked --release -p paimon --lib variant: 123 passed, 0 failed (2 existing ignored tests). Formatting/diff checks pass. CI is still running; keeping this PR in draft.

@JingsongLi
JingsongLi merged commit ea90bef into apache:main Nov 23, 2026
15 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