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

Method TestDoPut

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

Source from the content-addressed store, hash-verified

979 ASSERT_EQ(nullptr, chunk.data);
980}
981void AppMetadataTest::TestDoPut() {
982 std::shared_ptr<Schema> schema = ExampleIntSchema();
983 ASSERT_OK_AND_ASSIGN(auto do_put_result, client_->DoPut(FlightDescriptor{}, schema));
984 std::unique_ptr<FlightStreamWriter> writer = std::move(do_put_result.writer);
985
986 RecordBatchVector expected_batches;
987 ASSERT_OK(ExampleIntBatches(&expected_batches));
988
989 std::shared_ptr<RecordBatch> chunk;
990 std::shared_ptr<Buffer> metadata;
991 auto num_batches = static_cast<int>(expected_batches.size());
992 for (int i = 0; i < num_batches; ++i) {
993 ASSERT_OK(writer->WriteWithMetadata(*expected_batches[i],
994 Buffer::FromString(std::to_string(i))));
995 }
996 // Transports may behave unpredictably if streams are not
997 // drained. So explicitly close to see if the transport misbehaves
998 // (e.g. gRPC will hang if the Flight transport layer doesn't drain
999 // messages)
1000 ASSERT_OK(writer->Close());
1001}
1002// Test DoPut() with dictionaries. This tests a corner case in the
1003// server-side reader; see DoGetDictionaries above.
1004void AppMetadataTest::TestDoPutDictionaries() {

Callers

nothing calls this directly

Calls 15

ExampleIntSchemaFunction · 0.85
ExampleIntBatchesFunction · 0.85
FromStringFunction · 0.85
to_stringFunction · 0.85
CheckBuffersOnDeviceFunction · 0.85
AssertBatchesEqualFunction · 0.85
CheckErrorDetailFunction · 0.85
RecordBatchFromJSONFunction · 0.85
PathFunction · 0.70
schemaFunction · 0.50
fieldFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected