Skip to content

Return errors from decimal conversions - #82

Merged
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
decimal-errors-df55
Sep 18, 2026
Merged

osipovartem merged 1 commit into
embucket-sync-df55.0.0from
decimal-errors-df55

Conversation

@osipovartem

Copy link
Copy Markdown

Summary

  • make decimal_from_i128_with_scale and decimal_mantissa return Result instead of panicking on invalid scale or coefficients outside i128
  • encode decimal manifest bytes directly from the U128 coefficient, preserving minimal two's-complement output without narrowing
  • propagate conversion failures through DataFusion statistics and conservatively disable pruning for invalid decimal bounds
  • replace the existing string-based constructor path with fixed-width integer/exponent operations

This mirrors the fix requested during review of JanKaul/iceberg-rust#405.

Performance

The successful constructor path no longer allocates intermediate strings or parses them back into D128. Decimal manifest serialization remains infallible and uses the fixed-width coefficient directly.

Verification

  • cargo +1.95.0 test -p iceberg-rust-spec spec::decimal::tests
  • cargo +1.95.0 test -p datafusion_iceberg converts_precision_38_decimal_bound_to_datafusion
  • cargo +1.95.0 clippy -p iceberg-rust-spec -p datafusion_iceberg --all-targets -- -D warnings

@osipovartem
osipovartem merged commit 6025b96 into embucket-sync-df55.0.0 Sep 18, 2026
2 checks passed
@osipovartem
osipovartem deleted the decimal-errors-df55 branch September 18, 2026 12:22
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.

1 participant