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

Method Equals

cpp/src/arrow/ipc/message.cc:186–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186bool Message::Equals(const Message& other) const {
187 int64_t metadata_bytes = std::min(metadata()->size(), other.metadata()->size());
188
189 if (!metadata()->Equals(*other.metadata(), metadata_bytes)) {
190 return false;
191 }
192
193 // Compare bodies, if they have them
194 auto this_body = body();
195 auto other_body = other.body();
196
197 const bool this_has_body = (this_body != nullptr) && (this_body->size() > 0);
198 const bool other_has_body = (other_body != nullptr) && (other_body->size() > 0);
199
200 if (this_has_body && other_has_body) {
201 return this_body->Equals(*other_body);
202 } else if (this_has_body ^ other_has_body) {
203 // One has a body but not the other
204 return false;
205 } else {
206 // Neither has a body
207 return true;
208 }
209}
210
211Result<std::unique_ptr<Message>> Message::ReadFrom(std::shared_ptr<Buffer> metadata,
212 io::InputStream* stream) {

Callers 15

ValidateArrowVsJsonFunction · 0.45
TESTFunction · 0.45
DeserializeMethod · 0.45
TESTFunction · 0.45
FromProtoFunction · 0.45
TEST_FFunction · 0.45
AssertFileContentsFunction · 0.45
TESTFunction · 0.45
TEST_PFunction · 0.45
TESTFunction · 0.45

Calls 4

metadataFunction · 0.50
sizeMethod · 0.45
metadataMethod · 0.45
bodyMethod · 0.45

Tested by 15

ValidateArrowVsJsonFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
AssertFileContentsFunction · 0.36
TESTFunction · 0.36
TEST_PFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
CheckTensorRoundTripMethod · 0.36