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

Method Init

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

Source from the content-addressed store, hash-verified

320 const arrow::Ordering& ordering() const override { return ordering_; }
321
322 arrow::Status Init() override {
323 ARROW_CHECK(ordering_.sort_keys().size() == 1) << "Only one sort key supported";
324
325 auto inputs = this->inputs();
326 for (size_t i = 0; i < inputs.size(); i++) {
327 ExecNode* input = inputs[i];
328 const auto& schema = input->output_schema();
329
330 const auto& sort_key = ordering_.sort_keys()[0];
331 if (sort_key.order != arrow::compute::SortOrder::Ascending) {
332 return Status::NotImplemented("Only ascending sort order is supported");
333 }
334
335 const FieldRef& ref = sort_key.target;
336 auto match_res = ref.FindOne(*schema);
337 if (!match_res.ok()) {
338 return Status::Invalid("Bad sort key : ", match_res.status().message());
339 }
340 ARROW_ASSIGN_OR_RAISE(auto match, match_res);
341 ARROW_DCHECK(match.indices().size() == 1);
342
343 ARROW_ASSIGN_OR_RAISE(auto input_state,
344 InputState::Make<std::shared_ptr<InputState>>(
345 i, input, this, backpressure_counter, schema,
346 std::move(match.indices()[0])));
347 state.push_back(std::move(input_state));
348 }
349 return Status::OK();
350 }
351
352 arrow::Status InputReceived(arrow::acero::ExecNode* input,
353 arrow::ExecBatch batch) override {

Callers

nothing calls this directly

Calls 8

indicesMethod · 0.80
push_backMethod · 0.80
NotImplementedFunction · 0.50
InvalidFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45
okMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected