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

Function SubstraitToJSON

cpp/src/arrow/engine/substrait/serde.cc:443–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443Result<std::string> SubstraitToJSON(std::string_view type_name, const Buffer& buf) {
444 std::string type_url = "/substrait." + std::string(type_name);
445
446 google::protobuf::io::ArrayInputStream buf_stream{buf.data(),
447 static_cast<int>(buf.size())};
448
449 std::string out;
450 google::protobuf::io::StringOutputStream out_stream{&out};
451
452 auto status = google::protobuf::util::BinaryToJsonStream(
453 GetGeneratedTypeResolver(), type_url, &buf_stream, &out_stream);
454 if (!status.ok()) {
455 return Status::Invalid("BinaryToJsonStream returned ", status);
456 }
457 return out;
458}
459
460} // namespace internal
461} // namespace engine

Callers 1

Calls 5

GetGeneratedTypeResolverFunction · 0.85
InvalidFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected