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

Method TestDoGetDictionaries

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

Test dictionaries. This tests a corner case in the reader: dictionary batches come in between the schema and the first record batch, so the server must take care to read application metadata from the record batch, and not one of the dictionary batches.

Source from the content-addressed store, hash-verified

960// batch, so the server must take care to read application metadata
961// from the record batch, and not one of the dictionary batches.
962void AppMetadataTest::TestDoGetDictionaries() {
963 Ticket ticket{"dicts"};
964 ASSERT_OK_AND_ASSIGN(std::unique_ptr<FlightStreamReader> stream,
965 client_->DoGet(ticket));
966
967 RecordBatchVector expected_batches;
968 ASSERT_OK(ExampleDictBatches(&expected_batches));
969
970 auto num_batches = static_cast<int>(expected_batches.size());
971 for (int i = 0; i < num_batches; ++i) {
972 ASSERT_OK_AND_ASSIGN(auto chunk, stream->Next());
973 ASSERT_NE(nullptr, chunk.data);
974 ASSERT_NE(nullptr, chunk.app_metadata);
975 ASSERT_BATCHES_EQUAL(*expected_batches[i], *chunk.data);
976 ASSERT_EQ(std::to_string(i), chunk.app_metadata->ToString());
977 }
978 ASSERT_OK_AND_ASSIGN(auto chunk, stream->Next());
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));

Callers

nothing calls this directly

Calls 6

ExampleDictBatchesFunction · 0.85
to_stringFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
DoGetMethod · 0.45
sizeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected