Skip to content

Commit e20ccb6

Browse files
authored
GH-46396: [C++][Documentation][Statistics] Revise the documentation to clarify that arrow::ArrayStatistics is ignored during arrow::Array comparisons (#46470)
### Rationale for this change as mentiond [here](#46396 (comment)), The document should be clarified that `arrow::ArrayStatistics` is not inlcuded in the `arrow::Array` comparasion ### What changes are included in this PR? Add documets for` arrow::Array::Equals`, `arrow::Array::ApproxEquals`, `arrow::Array::EqualsRange`, `arrow::ArrayEquals`, `arrow::ArrayApproxEquals`, `arrow::ArrayRangeEquals`, and `arrow::ArrayRangeApproxEquals` ### Are these changes tested? No ### Are there any user-facing changes? No * GitHub Issue: #46396 Authored-by: Arash Andishgar <arashandishgar1@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent ed36107 commit e20ccb6

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

cpp/src/arrow/array/array_base.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class ARROW_EXPORT Array {
123123
const uint8_t* null_bitmap_data() const { return null_bitmap_data_; }
124124

125125
/// Equality comparison with another array
126+
///
127+
/// Note that arrow::ArrayStatistics is not included in the comparison.
126128
bool Equals(const Array& arr, const EqualOptions& = EqualOptions::Defaults()) const;
127129
bool Equals(const std::shared_ptr<Array>& arr,
128130
const EqualOptions& = EqualOptions::Defaults()) const;
@@ -134,13 +136,17 @@ class ARROW_EXPORT Array {
134136
/// Approximate equality comparison with another array
135137
///
136138
/// epsilon is only used if this is FloatArray or DoubleArray
139+
///
140+
/// Note that arrow::ArrayStatistics is not included in the comparison.
137141
bool ApproxEquals(const std::shared_ptr<Array>& arr,
138142
const EqualOptions& = EqualOptions::Defaults()) const;
139143
bool ApproxEquals(const Array& arr,
140144
const EqualOptions& = EqualOptions::Defaults()) const;
141145

142146
/// Compare if the range of slots specified are equal for the given array and
143147
/// this array. end_idx exclusive. This methods does not bounds check.
148+
///
149+
/// Note that arrow::ArrayStatistics is not included in the comparison.
144150
bool RangeEquals(int64_t start_idx, int64_t end_idx, int64_t other_start_idx,
145151
const Array& other,
146152
const EqualOptions& = EqualOptions::Defaults()) const;

cpp/src/arrow/compare.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,29 @@ class EqualOptions {
9292
};
9393

9494
/// Returns true if the arrays are exactly equal
95+
///
96+
/// Note that arrow::ArrayStatistics is not included in the comparison.
9597
ARROW_EXPORT bool ArrayEquals(const Array& left, const Array& right,
9698
const EqualOptions& = EqualOptions::Defaults());
9799

98100
/// Returns true if the arrays are approximately equal. For non-floating point
99101
/// types, this is equivalent to ArrayEquals(left, right)
102+
///
103+
/// Note that arrow::ArrayStatistics is not included in the comparison.
100104
ARROW_EXPORT bool ArrayApproxEquals(const Array& left, const Array& right,
101105
const EqualOptions& = EqualOptions::Defaults());
102106

103107
/// Returns true if indicated equal-length segment of arrays are exactly equal
108+
///
109+
/// Note that arrow::ArrayStatistics is not included in the comparison.
104110
ARROW_EXPORT bool ArrayRangeEquals(const Array& left, const Array& right,
105111
int64_t start_idx, int64_t end_idx,
106112
int64_t other_start_idx,
107113
const EqualOptions& = EqualOptions::Defaults());
108114

109115
/// Returns true if indicated equal-length segment of arrays are approximately equal
116+
///
117+
/// Note that arrow::ArrayStatistics is not included in the comparison.
110118
ARROW_EXPORT bool ArrayRangeApproxEquals(const Array& left, const Array& right,
111119
int64_t start_idx, int64_t end_idx,
112120
int64_t other_start_idx,

0 commit comments

Comments
 (0)