arashandishgar commented on PR #46031: URL: https://github.com/apache/arrow/pull/46031#issuecomment-2782514959
> The PR description says that this is a "Critical Fix". Why do you think that this is a "Critical Fix"? "The issue with the initial implementation (the one in the main branch) is that `RecordBatch::MakeStatisticsArray() `cannot handle `large_utf8` and `large_binary`. I’m referring to the following code in the main branch ``` TEST_F(TestRecordBatch, MakeStatisticsArrayString) { auto schema = ::arrow::schema({field("no-statistics", boolean()), field("string", large_utf8())}); auto no_statistics_array = ArrayFromJSON(boolean(), "[true, false, true]"); auto string_array_data = ArrayFromJSON(large_utf8(), "[\"a\", null, \"c\"]")->data()->Copy(); string_array_data->statistics = std::make_shared<ArrayStatistics>(); string_array_data->statistics->is_max_exact = true; string_array_data->statistics->max = "c"; auto string_array = MakeArray(std::move(string_array_data)); auto batch = RecordBatch::Make(schema, string_array->length(), {no_statistics_array, string_array}); ASSERT_OK_AND_ASSIGN(auto statistics_array, batch->MakeStatisticsArray()); ARROW_LOGGER_INFO("",statistics_array->ToString()); } ``` print a massage like ``` /home/arashandishgar/Desktop/arrow/cpp/src/arrow/record_batch_test.cc:1440: -- is_valid: all not null Running main() from /home/arashandishgar/Desktop/arrow/cpp/cmake-build-ninja-debug-1/_deps/googletest-src/googletest/src/gtest_main.cc -- child 0 type: int32 [ null, 1 ] -- child 1 type: map<dictionary<values=string, indices=int32, ordered=0>, dense_union<int64: int64=0, large_utf8: large_string=1>> <Invalid array: List child array invalid: Invalid: Struct child array #1 invalid: Invalid: Union child array #1 invalid: Invalid: Offsets buffer size (bytes): 12 isn't large enough for length: 1 and offset: 0 /home/arashandishgar/Desktop/arrow/cpp/src/arrow/array/validate.cc:597 ValidateOffsetsAndSizes(type, values.size()) /home/arashandishgar/Desktop/arrow/cpp/src/arrow/array/validate.cc:176 ValidateBinaryLike(type) /home/arashandishgar/Desktop/arrow/cpp/src/arrow/array/validate.cc:277 ValidateListLike(type)> ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org