kou commented on issue #46485:
URL: https://github.com/apache/arrow/issues/46485#issuecomment-2907722275

   Can we use `Fn` or something instead?
   (`*data.statistics` doesn't work when `data.statistics.get() == nullptr`.)
   
   ```diff
   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;
    }
   ```


-- 
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

Reply via email to