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

kou 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 01e3f1e682 GH-45578: [C++] Use max not min in 
MakeStatisticsArrayMaxApproximate test (#45579)
01e3f1e682 is described below

commit 01e3f1e6829d6fcc9021ac47aebb6350590ca134
Author: Arash Andishgar <[email protected]>
AuthorDate: Thu Feb 20 08:23:05 2025 +0330

    GH-45578: [C++] Use max not min in MakeStatisticsArrayMaxApproximate test 
(#45579)
    
    
    
    ### Rationale for this change
    
    The test was written for min instead of max.
    
    ### What changes are included in this PR?
    
    Use max not min for MaxApproximate test case.
    
    ### Are these changes tested?
    
    Yes, by dedicated unit tests.
    
    ### Are there any user-facing changes?
    No
    * GitHub Issue: #45578
    
    Authored-by: arash andishgar <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/record_batch_test.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpp/src/arrow/record_batch_test.cc 
b/cpp/src/arrow/record_batch_test.cc
index d41a67f35e..a659f8798e 100644
--- a/cpp/src/arrow/record_batch_test.cc
+++ b/cpp/src/arrow/record_batch_test.cc
@@ -1398,7 +1398,7 @@ TEST_F(TestRecordBatch, 
MakeStatisticsArrayMaxApproximate) {
   auto no_statistics_array = ArrayFromJSON(boolean(), "[true, false, true]");
   auto float64_array_data = ArrayFromJSON(float64(), "[1.0, null, 
-1.0]")->data()->Copy();
   float64_array_data->statistics = std::make_shared<ArrayStatistics>();
-  float64_array_data->statistics->min = -1.0;
+  float64_array_data->statistics->max = 1.0;
   auto float64_array = MakeArray(std::move(float64_array_data));
   auto batch = RecordBatch::Make(schema, float64_array->length(),
                                  {no_statistics_array, float64_array});
@@ -1412,13 +1412,13 @@ TEST_F(TestRecordBatch, 
MakeStatisticsArrayMaxApproximate) {
                                ARROW_STATISTICS_KEY_ROW_COUNT_EXACT,
                            },
                            {
-                               ARROW_STATISTICS_KEY_MIN_VALUE_APPROXIMATE,
+                               ARROW_STATISTICS_KEY_MAX_VALUE_APPROXIMATE,
                            }},
                           {{
                                ArrayStatistics::ValueType{int64_t{3}},
                            },
                            {
-                               ArrayStatistics::ValueType{-1.0},
+                               ArrayStatistics::ValueType{1.0},
                            }}));
   AssertArraysEqual(*expected_statistics_array, *statistics_array, true);
 }

Reply via email to