kou commented on code in PR #42133:
URL: https://github.com/apache/arrow/pull/42133#discussion_r1675364904


##########
cpp/src/arrow/array/array_base.h:
##########
@@ -232,6 +232,14 @@ class ARROW_EXPORT Array {
   /// \return DeviceAllocationType
   DeviceAllocationType device_type() const { return data_->device_type(); }
 
+  /// \brief Return the statistics of this Array
+  ///
+  /// This just delegates to calling statistics on the underlying ArrayData
+  /// object which backs this Array.
+  ///
+  /// \return const ArrayStatistics&
+  const ArrayStatistics& statistics() const { return data_->statistics; }

Review Comment:
   Done:
   
   * I've added `Array::Array(const std::shared_ptr<ArrayData>& data, const 
std::shared_ptr<ArrayStatistics>& statistics)` that calls `SetData()` and 
`SetStatistics()` and use it instead of direct `SetData()` call (as much as 
possible) in sub arrays.
   * I've added `ValidateData()` and it's called by `SetData()` to use 
`Array::Array(data, statistics)` in sub arrays.
   * I've unified `const std::shared_ptr<ArrayData>& data` argument and 
`std::shared_ptr<ArrayData> data` argument in sub array's constructors to 
`const &` because related codes use `const &`.
   
   There are many small diffs for the change. Review may be a bit difficult.



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