Skip to content

Commit

Permalink
Fix operator precedence problem in Parquet reader (rapidsai#15638)
Browse files Browse the repository at this point in the history
Fixes an operator precedence problem with a bitwise `&` that was not detected because it was accidentally correct. `PAGEINFO_FLAGS_DICTIONARY` has a value of '1', so `PAGEINFO_FLAGS_DICTIONARY != 0` evaluates to '1', and that ANDed with the page flags evaluates `true` when the bit is set.

Authors:
  - Ed Seidl (https://github.com/etseidl)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Vukasin Milovanovic (https://github.com/vuule)
  - Nghia Truong (https://github.com/ttnghia)

URL: rapidsai#15638
  • Loading branch information
etseidl authored May 2, 2024
1 parent 2fccbc0 commit 541b53a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/io/parquet/page_decode.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct null_count_back_copier {
*/
constexpr bool is_string_col(PageInfo const& page, device_span<ColumnChunkDesc const> chunks)
{
if (page.flags & PAGEINFO_FLAGS_DICTIONARY != 0) { return false; }
if ((page.flags & PAGEINFO_FLAGS_DICTIONARY) != 0) { return false; }
auto const& col = chunks[page.chunk_idx];
return is_string_col(col);
}
Expand Down

0 comments on commit 541b53a

Please sign in to comment.