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.
| 960 | // batch, so the server must take care to read application metadata |
| 961 | // from the record batch, and not one of the dictionary batches. |
| 962 | void 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 | } |
| 981 | void AppMetadataTest::TestDoPut() { |
| 982 | std::shared_ptr<Schema> schema = ExampleIntSchema(); |
| 983 | ASSERT_OK_AND_ASSIGN(auto do_put_result, client_->DoPut(FlightDescriptor{}, schema)); |
nothing calls this directly
no test coverage detected