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

Method GetNextInternal

be/src/exec/hdfs-scan-node.cc:120–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120Status HdfsScanNode::GetNextInternal(
121 RuntimeState* state, RowBatch* row_batch, bool* eos) {
122 RETURN_IF_ERROR(ExecDebugAction(TExecNodePhase::GETNEXT, state));
123 RETURN_IF_CANCELLED(state);
124 RETURN_IF_ERROR(QueryMaintenance(state));
125
126 if (ReachedLimitShared()) {
127 // LIMIT 0 case. Other limit values handled below.
128 DCHECK_EQ(limit_, 0);
129 *eos = true;
130 return Status::OK();
131 }
132 *eos = false;
133 unique_ptr<RowBatch> materialized_batch = thread_state_.batch_queue()->GetBatch();
134 if (materialized_batch != NULL) {
135 row_batch->AcquireState(materialized_batch.get());
136 // Note that the scanner threads may have processed and queued up extra rows before
137 // this thread incremented the rows returned.
138 if (CheckLimitAndTruncateRowBatchIfNeededShared(row_batch, eos)) SetDone();
139 COUNTER_SET(rows_returned_counter_, rows_returned_shared());
140 materialized_batch.reset();
141 return Status::OK();
142 }
143 // The RowBatchQueue was shutdown either because all scan ranges are complete or a
144 // scanner thread encountered an error. Check status_ to distinguish those cases.
145 *eos = true;
146 unique_lock<timed_mutex> l(lock_);
147 return status_;
148}
149
150Status HdfsScanNode::Prepare(RuntimeState* state) {
151 SCOPED_TIMER(runtime_profile_->total_time_counter());

Callers

nothing calls this directly

Calls 6

OKFunction · 0.85
batch_queueMethod · 0.80
AcquireStateMethod · 0.80
getMethod · 0.65
resetMethod · 0.65
GetBatchMethod · 0.45

Tested by

no test coverage detected