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

Function TestSourceSinkError

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

Source from the content-addressed store, hash-verified

275
276template <typename ElementType, typename OptionsType>
277void TestSourceSinkError(
278 std::string source_factory_name,
279 std::function<Result<std::vector<ElementType>>(const BatchesWithSchema&)>
280 to_elements) {
281 ASSERT_OK_AND_ASSIGN(auto plan, ExecPlan::Make());
282 std::shared_ptr<Schema> no_schema;
283
284 auto exp_batches = MakeBasicBatches();
285 ASSERT_OK_AND_ASSIGN(auto elements, to_elements(exp_batches));
286 auto element_it_maker = [&elements]() {
287 return MakeVectorIterator<ElementType>(elements);
288 };
289
290 auto null_executor_options = OptionsType{exp_batches.schema, element_it_maker};
291 ASSERT_OK(MakeExecNode(source_factory_name, plan.get(), {}, null_executor_options));
292
293 auto null_schema_options = OptionsType{no_schema, element_it_maker};
294 ASSERT_THAT(MakeExecNode(source_factory_name, plan.get(), {}, null_schema_options),
295 Raises(StatusCode::Invalid, HasSubstr("not null")));
296
297 auto no_io_but_executor = OptionsType{exp_batches.schema, element_it_maker,
298 io::default_io_context().executor()};
299 no_io_but_executor.requires_io = false;
300 ASSERT_THAT(MakeExecNode(source_factory_name, plan.get(), {}, no_io_but_executor),
301 Raises(StatusCode::Invalid, HasSubstr("io_executor was not nullptr")));
302}
303
304template <typename ElementType, typename OptionsType>
305void TestSourceSink(

Callers

nothing calls this directly

Calls 5

MakeExecNodeFunction · 0.85
RaisesFunction · 0.85
MakeBasicBatchesFunction · 0.70
getMethod · 0.45
executorMethod · 0.45

Tested by

no test coverage detected