Skip to content

[Variant] Preserve fixed-point JSON decimals - #11415

Draft
osipovartem wants to merge 4 commits into
apache:mainfrom
Embucket:upstream-variant-decimal-json
Draft

osipovartem wants to merge 4 commits into
apache:mainfrom
Embucket:upstream-variant-decimal-json

Conversation

@osipovartem

@osipovartem osipovartem commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Why

Preserve fixed-point JSON numbers and integers wider than i64 as exact Variant
Decimal4/8/16 values instead of rounding through Double. Exponent notation and
values outside the Variant decimal range retain the floating-point fallback.

Change

  • Preserve the original scale for representable values; trim redundant trailing
    fractional zeros only when the coefficient or scale otherwise cannot fit.
  • Preserve the sign of -0, -0.0, and -0.00.
  • Cover nested values, precision/scale boundaries, fallback, and
    string-versus-Value API behavior.

Review Status

Draft: stacked on #11409. Refreshed onto its actual head 749ede88d; the
decimal-only diff is the final two commits, 5d0bf05c4 and 97150fdca. GitHub's
diff against main still includes #11409 until that PR merges. This PR does not
depend on #11106. After #11409 merges, rebase to leave only the decimal commits.

Validation

Current refresh (97150fdca):

  • Both decimal patches are unchanged in git range-diff against the former
    923ce5c9a / f6b5335a6 stack.
  • The complete parquet-variant, parquet-variant-json, and
    parquet-variant-compute directories are byte-identical to the former
    f6b5335a6 head. Parent changes are outside those directories, including
    dependency/workspace metadata; this is not a fresh native test result.
  • cargo +1.98.1 fmt --all --check and git diff --check pass.
  • Independent read-only review approved 97150fdca for draft publication only; no blocking findings within that scope, and no ready/merge approval.

Fresh selected fork CI on this exact head:

  • Owning tests
    pass: Variant 176 unit / 18 integration / 61 doctests; JSON 82 unit / six
    doctests; compute 371 unit / 15 doctests. All these selected results have zero
    failures and zero ignored tests.
  • Clippy
    and compilation checks
    pass for all three Variant crates.
  • The overall run is failed, not green: the separate audit job fails on
    dependency advisories. This branch's lockfile is identical to parent [Variant] Parse JSON directly into builders #11409's;
    upstream main at 33fd4cdb already selects patched quinn/zstd versions. No
    advisory is suppressed or changed into a passing check here. The final
    Required Checks aggregator is also red; it reports the failed suite rather
    than another native test failure.

Historical qualification at f6b5335a6:

  • cargo +1.98.1 test -p parquet-variant-json --lib: 82 passed.
  • cargo +1.98.1 clippy -p parquet-variant-json --all-targets -- -D warnings
    and formatting passed.
  • Independent review of the decimal-only diff approved with no blocking findings.

The fresh owning tests and Clippy above ran in the fork CI, not locally.
Older Rustice dependency artifacts are not used as a substitute. This does not
qualify Rustice end-to-end behavior or the other workspace/platform suites.

The representative json_to_variant benchmark merged upstream in #11411. A
focused performance comparison of the decimal fast and fallback paths remains
a pre-merge check. The draft status is intentional while performance and the
parent-merge gates remain open.

AI Assistance

AI tools assisted with implementation, test development, the rebase and PR text.
A separate AI agent reviewed the changes read-only. This disclosure does not
substitute for maintainer review or the validation gates listed above.

@osipovartem
osipovartem force-pushed the upstream-variant-decimal-json branch from da9bf1a to f6b5335 Compare October 23, 2026 23:43
@osipovartem
osipovartem force-pushed the upstream-variant-decimal-json branch from f6b5335 to 97150fd Compare November 18, 2026 16:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet-variant parquet-variant* crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant