MCPcopy Create free account
hub / github.com/apache/impala / Reset

Method Reset

be/src/exec/analytic-eval-node.cc:842–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

840}
841
842Status AnalyticEvalNode::Reset(RuntimeState* state, RowBatch* row_batch) {
843 result_tuples_.clear();
844 window_tuples_.clear();
845 last_result_idx_ = -1;
846 curr_partition_idx_ = -1;
847 prev_pool_last_result_idx_ = -1;
848 prev_pool_last_window_idx_ = -1;
849 input_eos_ = false;
850 // Transfer the ownership of all row-backing resources.
851 row_batch->tuple_data_pool()->AcquireData(prev_tuple_pool_.get(), false);
852 row_batch->tuple_data_pool()->AcquireData(curr_tuple_pool_.get(), false);
853 // Call Finalize() to clear evaluator allocations, but do not Close() them,
854 // so we can keep evaluating them.
855 if (curr_tuple_init_) {
856 AggFnEvaluator::Finalize(analytic_fn_evals_, curr_tuple_, dummy_result_tuple_);
857 curr_tuple_init_ = false;
858 }
859 // The following members will be re-created in Open().
860 // input_stream_ should have been closed by last GetNext() call.
861 if (input_stream_ != nullptr && !input_stream_->is_closed()) {
862 input_stream_->Close(row_batch, RowBatch::FlushMode::FLUSH_RESOURCES);
863 }
864 input_stream_.reset();
865 prev_input_tuple_ = nullptr;
866 prev_input_tuple_pool_->Clear();
867 curr_child_batch_->Reset();
868 return ExecNode::Reset(state, row_batch);
869}
870
871void AnalyticEvalNode::Close(RuntimeState* state) {
872 if (is_closed()) return;

Callers 1

ProcessChildBatchesMethod · 0.45

Calls 8

AcquireDataMethod · 0.80
tuple_data_poolMethod · 0.80
clearMethod · 0.65
getMethod · 0.65
resetMethod · 0.65
is_closedMethod · 0.45
CloseMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected