Skip to content

[C++][Parquet] RleDecoder::Get fails to return false on end for some bit widths #46094

Description

@lesterfan

Describe the bug, including details regarding any error messages, version, and platform.

On the current main branch, the specified behavior of arrow::util::RleDecoder::Get is to return false if there are no more elements. However, this behavior doesn't work for some bit widths. This failing test case illustrates this: lesterfan@2722055.

I added some logging to the above test case for the original/decoded vector values and lengths below. The RleDecoder seems to be reading some additional values at the end of the buffer for this particular case with bit_width = 17.

Note: Google Test filter = *Rle.DecoderGetBitWidthRoundTrip*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from Rle
[ RUN      ] Rle.DecoderGetBitWidthRoundTrip
values.size(): 100
values: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
decoded_values.size(): 104
decoded_values: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15794567, 15794567, 15794567, 15794567, 
/Users/lester/work/arrow/cpp/src/arrow/util/rle_encoding_test.cc:383: Failure
Expected equality of these values:
  values
    Which is: { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... }
  decoded_values
    Which is: { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... }

[  FAILED  ] Rle.DecoderGetBitWidthRoundTrip (0 ms)
[----------] 1 test from Rle (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] Rle.DecoderGetBitWidthRoundTrip

Component(s)

Parquet

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions