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

Function MakeUnifiedDiffFormatter

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

Source from the content-addressed store, hash-verified

954} // namespace
955
956Result<std::function<Status(const Array& edits, const Array& base, const Array& target)>>
957MakeUnifiedDiffFormatter(const DataType& type, std::ostream* os) {
958 if (type.id() == Type::NA) {
959 return [os](const Array& edits, const Array& base, const Array& target) {
960 if (base.length() != target.length()) {
961 *os << "# Null arrays differed" << std::endl
962 << "-" << base.length() << " nulls" << std::endl
963 << "+" << target.length() << " nulls" << std::endl;
964 }
965 return Status::OK();
966 };
967 }
968
969 ARROW_ASSIGN_OR_RAISE(auto formatter, MakeFormatter(type));
970 return UnifiedDiffFormatter(os, std::move(formatter));
971}
972
973Status VisitEditScript(
974 const Array& edits,

Callers 1

DoDiffAndFormatMethod · 0.85

Calls 4

OKFunction · 0.50
idMethod · 0.45
lengthMethod · 0.45

Tested by 1

DoDiffAndFormatMethod · 0.68