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

Function TestSourceSink

cpp/src/arrow/acero/plan_test.cc:305–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303
304template <typename ElementType, typename OptionsType>
305void 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
329void TestRecordBatchReaderSourceSink(
330 std::function<Result<std::shared_ptr<RecordBatchReader>>(const BatchesWithSchema&)>

Callers

nothing calls this directly

Calls 3

MakeBasicBatchesFunction · 0.70
AssertExecBatchesEqualFunction · 0.70

Tested by

no test coverage detected