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

Function TestSchemaRoundTrip

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

Source from the content-addressed store, hash-verified

726)example";
727
728void TestSchemaRoundTrip(const std::shared_ptr<Schema>& schema) {
729 arrow::internal::JsonWriter writer;
730
731 DictionaryFieldMapper mapper(*schema);
732
733 writer.StartObject();
734 ASSERT_OK(json::WriteSchema(*schema, mapper, &writer));
735 writer.EndObject();
736
737 ASSERT_OK_AND_ASSIGN(std::string_view json_schema, writer.GetString());
738
739 simdjson::dom::parser parser;
740 ASSERT_OK_AND_ASSIGN(auto d, internal::ResolveSimdjsonResult(
741 parser.parse(json_schema.data(), json_schema.size()),
742 "Failed to parse JSON"));
743
744 DictionaryMemo in_memo;
745 ASSERT_OK_AND_ASSIGN(auto result_schema,
746 json::ReadSchema(d, default_memory_pool(), &in_memo));
747 AssertSchemaEqual(schema, result_schema, /*check_metadata=*/true);
748}
749
750void TestArrayRoundTrip(const Array& array) {
751 static std::string name = "dummy";

Callers 2

TESTFunction · 0.85
CheckRoundtripFunction · 0.85

Calls 2

StartObjectMethod · 0.45
EndObjectMethod · 0.45

Tested by

no test coverage detected