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

[C++] Replace With Mask not correctly replacing nulls

    XMLWordPrintableJSON

Details

    Description

      I'm working in ARROW-1699 and using the method ReplaceWithArrayMask for replace the nulls using a generated mask, but the method gave me unexpected results when the input Array contains nulls and this nulls are replaced with values.
      When testing this special Test on vector_test_replace_test.cc

      this->Assert(ReplaceWithMask, this->array("[1, null, 1]"),
         this->mask("[false, true, false]"),
         this->array("[7]"),
         this->array("[1, 7, 1]"));

      The result is:

      Actual:
      [
      1,
      null,
      1
      ]

      And  debugging the code, the output values is correct, but the null_bitmap isn't updated and keep the original null_bitmap
      In the file vector_replace.cc  on line 202, the bitmap is updated only for turnoff the null replacement values

      This is and expected behavior or an issue on ReplaceWithArrayMask ? 

      Attachments

        1. image-2021-11-22-15-51-30-120.png
          20 kB
          Alvin Chunga Mamani

        Issue Links

          Activity

            People

              alvinj15 Alvin Chunga Mamani
              alvinj15 Alvin Chunga Mamani
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 2h 20m
                  2h 20m