| 303 | |
| 304 | template <typename ElementType, typename OptionsType> |
| 305 | void TestSourceSink( |
| 306 | std::string source_factory_name, |
| 307 | std::function<Result<std::vector<ElementType>>(const BatchesWithSchema&)> |
| 308 | to_elements) { |
| 309 | auto exp_batches = MakeBasicBatches(); |
| 310 | ASSERT_OK_AND_ASSIGN(auto elements, to_elements(exp_batches)); |
| 311 | auto element_it_maker = [&elements]() { |
| 312 | return MakeVectorIterator<ElementType>(elements); |
| 313 | }; |
| 314 | for (bool requires_io : {false, true}) { |
| 315 | for (bool use_threads : {false, true}) { |
| 316 | Declaration plan(source_factory_name, |
| 317 | OptionsType{exp_batches.schema, element_it_maker, requires_io}); |
| 318 | QueryOptions query_options; |
| 319 | query_options.use_threads = use_threads; |
| 320 | ASSERT_OK_AND_ASSIGN(auto result, |
| 321 | DeclarationToExecBatches(std::move(plan), query_options)); |
| 322 | // Should not need to ignore order since sink should sequence by implicit order |
| 323 | AssertExecBatchesEqual(result.schema, result.batches, exp_batches.batches); |
| 324 | AssertExecBatchesSequenced(result.batches); |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | void TestRecordBatchReaderSourceSink( |
| 330 | std::function<Result<std::shared_ptr<RecordBatchReader>>(const BatchesWithSchema&)> |
nothing calls this directly
no test coverage detected