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

Function CheckRoundtrip

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

Source from the content-addressed store, hash-verified

1164};
1165
1166void CheckRoundtrip(const RecordBatch& batch) {
1167 ExtensionTypeGuard guard({uuid(), dict_extension_type(), complex128()});
1168
1169 TestSchemaRoundTrip(batch.schema());
1170
1171 ASSERT_OK_AND_ASSIGN(auto writer, IntegrationJsonWriter::Open(batch.schema()));
1172 ASSERT_OK(writer->WriteRecordBatch(batch));
1173
1174 ASSERT_OK_AND_ASSIGN(auto json_data, writer->Finish());
1175
1176 ASSERT_OK_AND_ASSIGN(auto reader,
1177 IntegrationJsonReader::Open(std::make_shared<Buffer>(json_data)));
1178 ASSERT_OK_AND_ASSIGN(auto result_batch, reader->ReadRecordBatch(0));
1179 ASSERT_OK(result_batch->ValidateFull());
1180
1181 // take care of float rounding error in the text representation
1182 ApproxCompareBatch(batch, *result_batch);
1183}
1184
1185TEST_P(TestJsonRoundTrip, RoundTrip) {
1186 std::shared_ptr<RecordBatch> batch;

Callers 15

TEST_PFunction · 0.85
CheckRoundtripMethod · 0.85
TEST_PFunction · 0.85
TEST_FFunction · 0.85
TestSameDictPointerMethod · 0.85
TestSameDictValuesMethod · 0.85
TestDeltaDictMethod · 0.85

Calls 8

dict_extension_typeFunction · 0.85
complex128Function · 0.85
TestSchemaRoundTripFunction · 0.85
ApproxCompareBatchFunction · 0.85
uuidFunction · 0.50
schemaMethod · 0.45
WriteRecordBatchMethod · 0.45
ValidateFullMethod · 0.45

Tested by

no test coverage detected