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

Function TestSchemaRoundTrip

cpp/src/arrow/integration/json_integration_test.cc:725–746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723)example";
724
725void TestSchemaRoundTrip(const std::shared_ptr<Schema>& schema) {
726 rj::StringBuffer sb;
727 rj::Writer<rj::StringBuffer> writer(sb);
728
729 DictionaryFieldMapper mapper(*schema);
730
731 writer.StartObject();
732 ASSERT_OK(json::WriteSchema(*schema, mapper, &writer));
733 writer.EndObject();
734
735 std::string json_schema = sb.GetString();
736
737 rj::Document d;
738 // Pass explicit size to avoid ASAN issues with
739 // SIMD loads in RapidJson.
740 d.Parse(json_schema.data(), json_schema.size());
741
742 DictionaryMemo in_memo;
743 ASSERT_OK_AND_ASSIGN(auto result_schema,
744 json::ReadSchema(d, default_memory_pool(), &in_memo));
745 AssertSchemaEqual(schema, result_schema, /*check_metadata=*/true);
746}
747
748void TestArrayRoundTrip(const Array& array) {
749 static std::string name = "dummy";

Callers 2

TESTFunction · 0.85
CheckRoundtripFunction · 0.85

Calls 6

StartObjectMethod · 0.45
EndObjectMethod · 0.45
GetStringMethod · 0.45
ParseMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected