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

Method Make

cpp/src/arrow/acero/sorted_merge_node.cc:285–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283 }
284
285 static arrow::Result<arrow::acero::ExecNode*> Make(
286 arrow::acero::ExecPlan* plan, std::vector<arrow::acero::ExecNode*> inputs,
287 const arrow::acero::ExecNodeOptions& options) {
288 RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, static_cast<int>(inputs.size()),
289 "SortedMergeNode"));
290
291 if (inputs.size() < 1) {
292 return Status::Invalid("Constructing a `SortedMergeNode` with < 1 inputs");
293 }
294
295 const auto schema = inputs.at(0)->output_schema();
296 for (const auto& input : inputs) {
297 if (!input->output_schema()->Equals(schema)) {
298 return Status::Invalid(
299 "SortedMergeNode input schemas must all "
300 "match, first schema "
301 "was: ",
302 schema->ToString(), " got schema: ", input->output_schema()->ToString());
303 }
304 }
305
306 const auto& order_options =
307 arrow::internal::checked_cast<const OrderByNodeOptions&>(options);
308
309 if (order_options.ordering.is_implicit() || order_options.ordering.is_unordered()) {
310 return Status::Invalid("`ordering` must be an explicit non-empty ordering");
311 }
312
313 std::shared_ptr<Schema> output_schema = inputs[0]->output_schema();
314 return plan->EmplaceNode<SortedMergeNode>(
315 plan, std::move(inputs), std::move(output_schema), order_options.ordering);
316 }
317
318 const char* kind_name() const override { return "SortedMergeNode"; }
319

Callers

nothing calls this directly

Calls 5

ValidateExecNodeInputsFunction · 0.85
InvalidFunction · 0.50
sizeMethod · 0.45
EqualsMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected