MCPcopy Create free account
hub / github.com/apache/arrow / Equals

Method Equals

cpp/src/arrow/chunked_array.cc:129–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127} // namespace
128
129bool ChunkedArray::Equals(const ChunkedArray& other, const EqualOptions& opts) const {
130 if (this == &other) {
131 if (opts.nans_equal()) {
132 return true;
133 } else if (!ContainsFloatType(*type_)) {
134 return true;
135 }
136 }
137 if (length_ != other.length()) {
138 return false;
139 }
140 if (null_count_ != other.null_count()) {
141 return false;
142 }
143 // We cannot toggle check_metadata here yet, so we don't check it
144 if (!type_->Equals(*other.type_, /*check_metadata=*/false)) {
145 return false;
146 }
147
148 // Check contents of the underlying arrays. This checks for equality of
149 // the underlying data independently of the chunk size.
150 return internal::ApplyBinaryChunked(
151 *this, other,
152 [&](const Array& left_piece, const Array& right_piece,
153 int64_t ARROW_ARG_UNUSED(position)) {
154 if (!left_piece.Equals(right_piece, opts)) {
155 return Status::Invalid("Unequal piece");
156 }
157 return Status::OK();
158 })
159 .ok();
160}
161
162bool ChunkedArray::Equals(const std::shared_ptr<ChunkedArray>& other,
163 const EqualOptions& opts) const {

Callers 2

MakeMethod · 0.45
ValidateChunksFunction · 0.45

Calls 9

ContainsFloatTypeFunction · 0.85
ApplyBinaryChunkedFunction · 0.85
InvalidFunction · 0.70
OKFunction · 0.70
EqualsFunction · 0.70
lengthMethod · 0.45
null_countMethod · 0.45
okMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected