andishgar commented on issue #46485: URL: https://github.com/apache/arrow/issues/46485#issuecomment-2907728585
> Can we use `Fn` or something instead? (`*data.statistics` doesn't work when `data.statistics.get() == nullptr`.) > > diff --git a/cpp/src/arrow/array/data.cc b/cpp/src/arrow/array/data.cc > index 2e55668fb9..6da4bb5317 100644 > --- a/cpp/src/arrow/array/data.cc > +++ b/cpp/src/arrow/array/data.cc > @@ -165,7 +165,11 @@ Result<std::shared_ptr<ArrayData>> CopyToImpl(const ArrayData& data, > ARROW_ASSIGN_OR_RAISE(output->dictionary, CopyToImpl(*data.dictionary, to, copy_fn)); > } > > - output->statistics = data.statistics; > + if (std::is_same_v<Fn, decltype(MemoryManager::CopyBuffer)>) { > + output->statistics = data.statistics; > + } else { > + output->statistics = std::make_shared<ArrayStatistics>(*data.statistics); > + } > > return output; > } Because of this, the following line is not completely correct. However, let's discuss it in another issue that I will create soon https://github.com/apache/arrow/blob/153da3053b62f8f9bcafb87546e12a979e605734/cpp/src/arrow/array/data.cc#L179-L182 -- 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