Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.0, 3.0.0
Description
When attempting to CombineChunks() on an arrow::Table containing a FixedSizeList type Array, the child arrays of the FixedSizeLists are not properly concatenated. The lengths of the child array being set incorrectly. I ran into this when trying to ToString() the combined RecordBatch.
This seems to be because this function in :
cpp/arrow/array/concatenate.cc
Result<std::vector<std::shared_ptr<const ArrayData>>> ChildData(size_t index)
... used to calculate offsets and slice lengths before actual concatenation doesn't take the list lengths into account.
The bug can be reproduced by adding the following unit test to:
cpp/arrow/array/concatenate_test.cc
TEST_F(ConcatenateTest, FixedSizeListType) { Check([this](int32_t size, double null_probability, std::shared_ptr<Array>* out) { auto list_size = 3; auto values_size = size * list_size; auto values = this->GeneratePrimitive<Int8Type>(values_size, null_probability); ASSERT_OK_AND_ASSIGN(*out, FixedSizeListArray::FromArrays(values, list_size)); ASSERT_OK((**out).ValidateFull()); }); }
One possible approach to fix this would be to add another ChildData overload to ConcatenateImpl with a multiplier parameter, and multiply the offset and length of the slice by the multiplier. This function can be called by the FixedSizeList Visitor and be supplied with the list length as multiplier.
I have this fix ready but would like to know if this would be the right approach.
Attachments
Issue Links
- links to