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

Method ProcessSplit

be/src/exec/hdfs-scanner.cc:142–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142Status HdfsScanner::ProcessSplit() {
143 DCHECK(scan_node_->HasRowBatchQueue());
144 HdfsScanNode* scan_node = static_cast<HdfsScanNode*>(scan_node_);
145 bool returned_rows = false;
146 do {
147 // IMPALA-3798, IMPALA-3804: For sequence-based files, the filters are only
148 // applied in HdfsScanNode::ProcessSplit()
149 bool is_sequence_based = BaseSequenceScanner::FileFormatIsSequenceBased(
150 context_->partition_descriptor()->file_format());
151 if (!is_sequence_based && FilterContext::CheckForAlwaysFalse(FilterStats::SPLITS_KEY,
152 context_->filter_ctxs())) {
153 eos_ = true;
154 break;
155 }
156 unique_ptr<RowBatch> batch = std::make_unique<RowBatch>(scan_node_->row_desc(),
157 state_->batch_size(), scan_node_->mem_tracker());
158 if (scan_node_->is_partition_key_scan()) batch->limit_capacity(1);
159 Status status = GetNextInternal(batch.get());
160 if (batch->num_rows() > 0) returned_rows = true;
161 // Always add batch to the queue if any rows were returned because it may contain
162 // data referenced by previously appended batches.
163 if (returned_rows) scan_node->AddMaterializedRowBatch(move(batch));
164 RETURN_IF_ERROR(status);
165 // Only need to return one row per partition for partition key scans.
166 if (returned_rows && scan_node_->is_partition_key_scan()) eos_ = true;
167 } while (!eos_ && !scan_node_->ReachedLimitShared());
168 return Status::OK();
169}
170
171void HdfsScanner::Close() {
172 DCHECK(scan_node_->HasRowBatchQueue());

Callers

nothing calls this directly

Calls 14

moveFunction · 0.85
OKFunction · 0.85
partition_descriptorMethod · 0.80
batch_sizeMethod · 0.80
is_partition_key_scanMethod · 0.80
limit_capacityMethod · 0.80
ReachedLimitSharedMethod · 0.80
getMethod · 0.65
HasRowBatchQueueMethod · 0.45
file_formatMethod · 0.45
row_descMethod · 0.45

Tested by

no test coverage detected