This is an automated email from the ASF dual-hosted git repository.

wjones127 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new f01853d775 MINOR: [C++][Parquet] Fix column_reader_test (#35233)
f01853d775 is described below

commit f01853d775d484d644f9cb06f5bf06d32b6cc7b3
Author: Gang Wu <[email protected]>
AuthorDate: Thu Apr 20 02:35:43 2023 +0800

    MINOR: [C++][Parquet] Fix column_reader_test (#35233)
    
    ### Rationale for this change
    
    https://github.com/apache/arrow/pull/14142 implemented the logic to skip 
parquet records and added a lot of test caese. However, there is a minor issue 
in the test function `RecordReaderPrimitiveTypeTest::CheckReadValues` where `!` 
is missing.
    
    ```c++
        if (descr_->schema_node()->is_required()) {
          std::vector<int16_t> read_defs(
              record_reader_->def_levels(),
              record_reader_->def_levels() + record_reader_->levels_position());
          ASSERT_TRUE(vector_equal(expected_defs, read_defs));
        }
    
    ```
    
    ### What changes are included in this PR?
    
    Add `!` to `if (descr_->schema_node()->is_required())` as mentioned above.
    
    ### Are these changes tested?
    
    This is a fix to the test case.
    
    ### Are there any user-facing changes?
    
    NO.
    
    Authored-by: Gang Wu <[email protected]>
    Signed-off-by: Will Jones <[email protected]>
---
 cpp/src/parquet/column_reader_test.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/src/parquet/column_reader_test.cc 
b/cpp/src/parquet/column_reader_test.cc
index 2cb6aaa04d..b3b75a7bb5 100644
--- a/cpp/src/parquet/column_reader_test.cc
+++ b/cpp/src/parquet/column_reader_test.cc
@@ -697,7 +697,7 @@ class RecordReaderPrimitiveTypeTest
       }
     }
 
-    if (descr_->schema_node()->is_required()) {
+    if (!descr_->schema_node()->is_required()) {
       std::vector<int16_t> read_defs(
           record_reader_->def_levels(),
           record_reader_->def_levels() + record_reader_->levels_position());

Reply via email to