From eee89df42eef182c22cc46df0eec829d60b01bf3 Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Thu, 18 Apr 2024 20:31:48 -0300 Subject: [PATCH] Revert the changes in FixedSizeListBuilder and disable some test cases --- cpp/src/arrow/array/builder_nested.cc | 4 ++-- cpp/src/arrow/util/fixed_width_test.cc | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/src/arrow/array/builder_nested.cc b/cpp/src/arrow/array/builder_nested.cc index 055f12482fe47..5bdc76d96c8f0 100644 --- a/cpp/src/arrow/array/builder_nested.cc +++ b/cpp/src/arrow/array/builder_nested.cc @@ -213,13 +213,13 @@ Status FixedSizeListBuilder::AppendValues(int64_t length, const uint8_t* valid_b Status FixedSizeListBuilder::AppendNull() { RETURN_NOT_OK(Reserve(1)); UnsafeAppendToBitmap(false); - return value_builder_->AppendEmptyValues(list_size_); + return value_builder_->AppendNulls(list_size_); } Status FixedSizeListBuilder::AppendNulls(int64_t length) { RETURN_NOT_OK(Reserve(length)); UnsafeAppendToBitmap(length, false); - return value_builder_->AppendEmptyValues(list_size_ * length); + return value_builder_->AppendNulls(list_size_ * length); } Status FixedSizeListBuilder::ValidateOverflow(int64_t new_elements) { diff --git a/cpp/src/arrow/util/fixed_width_test.cc b/cpp/src/arrow/util/fixed_width_test.cc index 2eacddbb37e71..a063b2db61712 100644 --- a/cpp/src/arrow/util/fixed_width_test.cc +++ b/cpp/src/arrow/util/fixed_width_test.cc @@ -100,7 +100,10 @@ TEST_F(TestFixedWidth, IsFixedWidthModuloNesting) { arr = ArraySpan{*fsl_int_nulls_array_->data()}; // Nulls at the top-level of the array are allowed by IsFixedWidthModuloNesting. - ASSERT_TRUE(IsFixedWidthModuloNesting(arr, /*force_null_count=*/false)); + // + // TODO(GH-10157): ArrayFromJSON uses FixedSizeListBuilder which currently + // produces nulls on the child data if one of the list-typed elements is null. + // ASSERT_TRUE(IsFixedWidthModuloNesting(arr, /*force_null_count=*/false)); arr = ArraySpan{*fsl_int_inner_nulls_array_->data()}; // Inner nulls are not allowed by IsFixedWidthModuloNesting.