fix: reject inconsistent parameterized ScalarValues - #24539
Open
Theodus wants to merge 1 commit into
Open
Conversation
Validate decimal precision and scale, timestamp timezones, and fixed-size binary widths in ScalarValue::iter_to_array. Extend fuzz generation and mutation coverage for these parameterized types.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24539 +/- ##
==========================================
- Coverage 81.32% 81.32% -0.01%
==========================================
Files 1117 1117
Lines 396269 396280 +11
Branches 396269 396280 +11
==========================================
- Hits 322260 322255 -5
- Misses 55186 55197 +11
- Partials 18823 18828 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Which issue does this PR close?
ScalarValue::iter_to_arrayaccepts mismatched type parameters #24538.Rationale for this change
The
ScalarValueconversion fuzz tests round-trip arrays whose scalars all have the sameDataType. The generator also omits timestamps with timezones andFixedSizeBinaryarrays. The tests therefore do not cover mismatched type parameters.The added coverage exposes a bug in
ScalarValue::iter_to_array. The function accepts mismatched decimal precision, decimal scale, timestamp timezone, and fixed-size binary width. It builds the array with the first scalar's parameters and discards the conflicting parameters.What changes are included in this PR?
FixedSizeBinaryarrays with widths 1, 8, and 32.ScalarValue::iter_to_arrayrejects the mismatch.ScalarValue::iter_to_arrayreject inconsistent decimal parameters, timestamp timezones, and fixed-size binary widths.Are these changes tested?
Yes.
scalar_value_iter_to_array_rejects_mixed_parameterized_typescovers decimal precision, decimal scale, timestamp timezone, and fixed-size binary width mismatches. The existing roundtrip test now covers timestamps with timezones andFixedSizeBinaryarrays.Are there any user-facing changes?
Yes.
ScalarValue::iter_to_arraynow returns an error when its inputs have different parameterized logical types. The public API signature does not change.