From 541b53a97eeb2c8bc14a834b517b6f7f81c76328 Mon Sep 17 00:00:00 2001 From: Ed Seidl Date: Thu, 2 May 2024 13:23:28 -0700 Subject: [PATCH] Fix operator precedence problem in Parquet reader (#15638) 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: https://github.com/rapidsai/cudf/pull/15638 --- cpp/src/io/parquet/page_decode.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/io/parquet/page_decode.cuh b/cpp/src/io/parquet/page_decode.cuh index 0c139fced24..4c811449c70 100644 --- a/cpp/src/io/parquet/page_decode.cuh +++ b/cpp/src/io/parquet/page_decode.cuh @@ -122,7 +122,7 @@ struct null_count_back_copier { */ constexpr bool is_string_col(PageInfo const& page, device_span 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); }