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

Function Diff

cpp/src/arrow/array/diff.cc:1011–1031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009}
1010
1011Result<std::shared_ptr<StructArray>> Diff(const Array& base, const Array& target,
1012 MemoryPool* pool) {
1013 if (!base.type()->Equals(target.type())) {
1014 return Status::TypeError("only taking the diff of like-typed arrays is supported.");
1015 }
1016
1017 if (base.type()->id() == Type::NA) {
1018 return NullDiff(base, target, pool);
1019 } else if (base.type()->id() == Type::EXTENSION) {
1020 auto base_storage = checked_cast<const ExtensionArray&>(base).storage();
1021 auto target_storage = checked_cast<const ExtensionArray&>(target).storage();
1022 return Diff(*base_storage, *target_storage, pool);
1023 } else if (base.type()->id() == Type::DICTIONARY) {
1024 return Status::NotImplemented("diffing arrays of type ", *base.type());
1025 } else if (base.type()->id() == Type::LIST_VIEW ||
1026 base.type()->id() == Type::LARGE_LIST_VIEW) {
1027 return Status::NotImplemented("diffing arrays of type ", *base.type());
1028 } else {
1029 return QuadraticSpaceMyersDiff(base, target, pool).Diff();
1030 }
1031}
1032
1033} // namespace arrow

Callers 2

DoDiffMethod · 0.85
TEST_FFunction · 0.85

Calls 8

NullDiffFunction · 0.85
TypeErrorFunction · 0.50
NotImplementedFunction · 0.50
EqualsMethod · 0.45
typeMethod · 0.45
idMethod · 0.45
DiffMethod · 0.45

Tested by 2

DoDiffMethod · 0.68
TEST_FFunction · 0.68