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

Function CheckRoundtrip

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

Source from the content-addressed store, hash-verified

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