Fix: skip boolean column when all values are false for optional arrays#2759
Open
marcsnid wants to merge 1 commit intoopen-telemetry:mainfrom
Open
Fix: skip boolean column when all values are false for optional arrays#2759marcsnid wants to merge 1 commit intoopen-telemetry:mainfrom
marcsnid wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (82.24%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## main #2759 +/- ##
===========================================
- Coverage 88.06% 82.24% -5.83%
===========================================
Files 644 181 -463
Lines 246791 52744 -194047
===========================================
- Hits 217340 43377 -173963
+ Misses 28927 8843 -20084
Partials 524 524
🚀 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.
Change Summary
Fix
AdaptiveBooleanArrayBuilderto skip producing an array when all values arefalseor null for optional columns. Previously, the builder only skipped on all-null:falsevalues triggered array creation even thoughfalseis the boolean default value. This makes boolean columns consistent with how integer (0) and string ("") columns handle defaults.Changes:
has_true_valueandoptionalfields toAdaptiveBooleanArrayBuilderfinish()now returnsNonewhenoptionaland!has_true_valuetest_metrics_round_tripto reflect that theis_monotoniccolumn (allfalse/null) is now correctly omittedWhat issue does this PR close?
#1449
How are these changes tested?
boolean.rs:test_adaptive_boolean_builder_all_false— all-false optional →Nonetest_adaptive_boolean_builder_false_and_null— mixed false+null optional →Nonetest_adaptive_boolean_builder_false_then_true— false then true →Some(array)with correct valuestest_adaptive_boolean_builder_all_false_non_optional— non-optional always produces arrayotap-df-pdatacontinue to pass (including the updatedtest_metrics_round_trip).Are there any user-facing changes?
No. This is an internal encoding optimization. Optional boolean columns that contain only default values (
false/null) are no longer included in Arrow record batches, reducing payload size.