Commit 2b5b918
authored
Fix problem writing sliced BooleanBuffers as fast-encoding format (apache#1522)
## Which issue does this PR close?
Closes apache#1520.
## Rationale for this change
This is a problem I found when working on apache#1511, the null bits were not correctly written and caused test failures. This patch is an attempt to fix it.
This patch is only aiming for fixing correctness problems. As apache#1190 (comment) pointed out, the fast BatchWriter may write full data buffer for sliced `Utf8` arrays, so there's still some performance implications when working with sliced arrays.
## What changes are included in this PR?
Correctly take slicing indices and length into account when writing BooleanBuffers. This applies to null bits of all arrays, and the values of boolean arrays.
## How are these changes tested?
Added a new round-trip test for sliced record batches.1 parent a31ece9 commit 2b5b918
1 file changed
+38
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
| 303 | + | |
305 | 304 | | |
306 | 305 | | |
307 | 306 | | |
| |||
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
318 | 330 | | |
319 | 331 | | |
320 | 332 | | |
| |||
621 | 633 | | |
622 | 634 | | |
623 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
624 | 659 | | |
625 | 660 | | |
626 | 661 | | |
| |||
0 commit comments