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

Function ArrowSchemaToParquetMetadata

cpp/src/parquet/arrow/arrow_schema_test.cc:982–991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

980}
981
982Status ArrowSchemaToParquetMetadata(std::shared_ptr<::arrow::Schema>& arrow_schema,
983 std::shared_ptr<KeyValueMetadata>& metadata) {
984 ARROW_ASSIGN_OR_RAISE(
985 std::shared_ptr<Buffer> serialized,
986 ::arrow::ipc::SerializeSchema(*arrow_schema, ::arrow::default_memory_pool()));
987 std::string schema_as_string = serialized->ToString();
988 std::string schema_base64 = ::arrow::util::base64_encode(schema_as_string);
989 metadata = ::arrow::key_value_metadata({"ARROW:schema"}, {schema_base64});
990 return Status::OK();
991}
992
993TEST_F(TestConvertParquetSchema, ParquetVariant) {
994 // Unshredded variant

Callers 1

TEST_FFunction · 0.85

Calls 6

default_memory_poolFunction · 0.85
key_value_metadataFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
SerializeSchemaFunction · 0.50
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected