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

Method TestDoPutReadMetadata

cpp/src/arrow/flight/test_definitions.cc:1026–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024 ASSERT_OK(writer->Close());
1025}
1026void AppMetadataTest::TestDoPutReadMetadata() {
1027 std::shared_ptr<Schema> schema = ExampleIntSchema();
1028 ASSERT_OK_AND_ASSIGN(auto do_put_result, client_->DoPut(FlightDescriptor{}, schema));
1029 std::unique_ptr<FlightStreamWriter> writer = std::move(do_put_result.writer);
1030 std::unique_ptr<FlightMetadataReader> reader = std::move(do_put_result.reader);
1031
1032 RecordBatchVector expected_batches;
1033 ASSERT_OK(ExampleIntBatches(&expected_batches));
1034
1035 std::shared_ptr<RecordBatch> chunk;
1036 std::shared_ptr<Buffer> metadata;
1037 auto num_batches = static_cast<int>(expected_batches.size());
1038 for (int i = 0; i < num_batches; ++i) {
1039 ASSERT_OK(writer->WriteWithMetadata(*expected_batches[i],
1040 Buffer::FromString(std::to_string(i))));
1041 ASSERT_OK(reader->ReadMetadata(&metadata));
1042 ASSERT_NE(nullptr, metadata);
1043 ASSERT_EQ(std::to_string(i), metadata->ToString());
1044 }
1045 // As opposed to DoPutDrainMetadata, now we've read the messages, so
1046 // make sure this still closes as expected.
1047 ASSERT_OK(writer->Close());
1048}
1049
1050//------------------------------------------------------------
1051// Test IPC options in data plane methods

Callers

nothing calls this directly

Calls 9

ExampleIntSchemaFunction · 0.85
ExampleIntBatchesFunction · 0.85
FromStringFunction · 0.85
to_stringFunction · 0.85
sizeMethod · 0.45
WriteWithMetadataMethod · 0.45
ReadMetadataMethod · 0.45
ToStringMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected