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

Method Equals

cpp/src/arrow/chunked_array.cc:121–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

MakeMethod · 0.45
ValidateChunksFunction · 0.45

Calls 10

ContainsFloatTypeFunction · 0.85
ApplyBinaryChunkedFunction · 0.85
nans_equalMethod · 0.80
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