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

Method NumOutputRowsReady

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

Source from the content-addressed store, hash-verified

765}
766
767inline int64_t AnalyticEvalNode::NumOutputRowsReady() const {
768 if (result_tuples_.empty()) return 0;
769 int64_t rows_to_return = last_result_idx_ - input_stream_->rows_returned();
770 if (last_result_idx_ > input_stream_->num_rows()) {
771 // This happens when we were able to add a result tuple before consuming child rows,
772 // e.g. initializing a new partition with an end bound that is X preceding. The first
773 // X rows get the default value and we add that tuple to result_tuples_ before
774 // consuming child rows. It's possible the result is negative, and that's fine
775 // because this result is only used to determine if the number of rows to return
776 // is at least as big as the batch size.
777 rows_to_return -= last_result_idx_ - input_stream_->num_rows();
778 } else {
779 DCHECK_GE(rows_to_return, 0);
780 }
781 return rows_to_return;
782}
783
784Status AnalyticEvalNode::GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos) {
785 SCOPED_TIMER(runtime_profile_->total_time_counter());

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
rows_returnedMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected