Repository navigation
Bound decimal storage by precision - #10305
Closed
joseph-isaacs wants to merge 13 commits into
Closed
joseph-isaacs wants to merge 13 commits into
joseph-isaacs wants to merge 13 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decimal arrays currently permit physical storage wider than the smallest type required by their precision. Establish
values_type <= DecimalType::smallest_decimal_value_type(decimal_dtype)as the storage contract so compute kernels can rely on this upper bound.try_new,try_new_handle) rather than narrowing it; storage within the bound is accepted without copying.DecimalData::narrow_to_precisionandDecimalArray::try_new_narrowedfor importers that receive wider storage than the precision requires. Arrow decimal imports, legacy serialized arrays, andDecimalBytePartsassembly narrow explicitly through them; device buffers cannot be narrowed and are rejected. The GPU byte-parts kernel validates its storage instead of constructing unchecked.Stack 1/2: based on
develop. The dispatch macros and kernel migrations are in #10314, based on this PR.Validation:
cargo clippy -p vortex-array -p vortex-arrow --all-targets --all-features -- -D warnings,cargo fmt --all --checkwith the pinned nightly, and the tests ofvortex-array,vortex-arrow,vortex-row,vortex-sparse,vortex-fuzzandvortex-decimal-byte-partspass locally with the CI profile. CI is green on the current head, including the CUDA, sanitizer and miri jobs.Compatibility: constructing a decimal array with storage wider than its precision requires is now an error (a panic from the infallible
newconstructors). Arrow imports of low-precisionDecimal128/Decimal256columns allocate to narrow their storage. Legacy files with oversized decimal storage still decode, with narrowing on the host; on the GPU they are rejected. As before, constructors require non-null values to fit their declared precision; this change does not add per-value precision validation.