[ 
https://issues.apache.org/jira/browse/ARROW-4186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17661210#comment-17661210
 ] 

Rok Mihevc commented on ARROW-4186:
-----------------------------------

This issue has been migrated to [issue 
#20769|https://github.com/apache/arrow/issues/20769] on GitHub. Please see the 
[migration documentation|https://github.com/apache/arrow/issues/14542] for 
further details.

> [C++] BitmapWriters clobber the first byte when length=0
> --------------------------------------------------------
>
>                 Key: ARROW-4186
>                 URL: https://issues.apache.org/jira/browse/ARROW-4186
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Ben Kietzman
>            Assignee: Antoine Pitrou
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 0.12.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When a BitmapWriter or FirstTimeBitmapWriter is constructed with length=0 
> then Finish() is invoked, the byte at {{start_offset / 8}} is zeroed
> The following change causes the test to fail:
> {code}
> --- a/cpp/src/arrow/util/bit-util-test.cc
> +++ b/cpp/src/arrow/util/bit-util-test.cc
> @@ -274,6 +274,10 @@ TEST(FirstTimeBitmapWriter, NormalOperation) {
>          auto writer = internal::FirstTimeBitmapWriter(bitmap, 10, 3);
>          WriteVectorToWriter(writer, {0, 0, 0});
>        }
> +      {
> +        auto writer = internal::FirstTimeBitmapWriter(bitmap, 13, 0);
> +        WriteVectorToWriter(writer, {});
> +      }
>        {
>          auto writer = internal::FirstTimeBitmapWriter(bitmap, 13, 3);
>          WriteVectorToWriter(writer, {1, 0, 1});
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to