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

Method MakeSort

cpp/src/arrow/acero/sink_node.cc:450–465  ·  view source on GitHub ↗

A sink node that accumulates inputs, then sorts them before emitting them.

Source from the content-addressed store, hash-verified

448
449 // A sink node that accumulates inputs, then sorts them before emitting them.
450 static Result<ExecNode*> MakeSort(ExecPlan* plan, std::vector<ExecNode*> inputs,
451 const ExecNodeOptions& options) {
452 RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 1, "OrderBySinkNode"));
453
454 const auto& sink_options = checked_cast<const OrderBySinkNodeOptions&>(options);
455 if (sink_options.backpressure.should_apply_backpressure()) {
456 return Status::Invalid("Backpressure cannot be applied to an OrderBySinkNode");
457 }
458 RETURN_NOT_OK(ValidateOrderByOptions(sink_options));
459 ARROW_ASSIGN_OR_RAISE(
460 std::unique_ptr<OrderByImpl> impl,
461 OrderByImpl::MakeSort(plan->query_context()->exec_context(),
462 inputs[0]->output_schema(), sink_options.sort_options));
463 return plan->EmplaceNode<OrderBySinkNode>(plan, std::move(inputs), std::move(impl),
464 sink_options.generator);
465 }
466
467 static Status ValidateCommonOrderOptions(const SinkNodeOptions& options) {
468 if (options.backpressure.should_apply_backpressure()) {

Callers

nothing calls this directly

Calls 5

ValidateExecNodeInputsFunction · 0.85
exec_contextMethod · 0.80
query_contextMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.70
InvalidFunction · 0.50

Tested by

no test coverage detected