[C++][Statistics] Fix the ownership handling of arrow::ArrayData::statistics in arrow::ArrayData::CopyTo and arrow::ArrayDataViewOrCopy
Open
Component: C++
Type: bug
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
As discussed [here](https://github.com/apache/arrow/issues/46485#issuecomment-2907631297), the following line should either share or copy arrow::ArrayData::statistics, depending on whether the buffers are copied or viewed.
https://github.com/apache/arrow/blob/8afaf95b38459f97ab12b22ebb7e1913b31025bf/cpp/src/arrow/array/data.cc#L167-L169
### Component(s)
C++
Contributor guide
Assessment
This issue has not been assessed yet.