| 140 | } |
| 141 | |
| 142 | Status 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 | |
| 171 | void HdfsScanner::Close() { |
| 172 | DCHECK(scan_node_->HasRowBatchQueue()); |
nothing calls this directly
no test coverage detected