Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-4186

[C++] BitmapWriters clobber the first byte when length=0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: C++

      Description

      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:

      --- 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});
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apitrou Antoine Pitrou
                Reporter:
                bkietz Benjamin Kietzman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m