| 758 | } |
| 759 | |
| 760 | Status HdfsOrcScanner::ProcessSplit() { |
| 761 | DCHECK(scan_node_->HasRowBatchQueue()); |
| 762 | HdfsScanNode* scan_node = static_cast<HdfsScanNode*>(scan_node_); |
| 763 | do { |
| 764 | unique_ptr<RowBatch> batch = make_unique<RowBatch>(scan_node_->row_desc(), |
| 765 | state_->batch_size(), scan_node_->mem_tracker()); |
| 766 | if (scan_node_->is_partition_key_scan()) batch->limit_capacity(1); |
| 767 | Status status = GetNextInternal(batch.get()); |
| 768 | |
| 769 | // If we are doing a partition key scan, we are done scanning the file after |
| 770 | // returning at least one row. |
| 771 | if (scan_node_->is_partition_key_scan() && batch->num_rows() > 0) eos_ = true; |
| 772 | |
| 773 | // Always add batch to the queue because it may contain data referenced by previously |
| 774 | // appended batches. |
| 775 | scan_node->AddMaterializedRowBatch(move(batch)); |
| 776 | RETURN_IF_ERROR(status); |
| 777 | ++row_batches_produced_; |
| 778 | if ((row_batches_produced_ & (BATCHES_PER_FILTER_SELECTIVITY_CHECK - 1)) == 0) { |
| 779 | CheckFiltersEffectiveness(); |
| 780 | } |
| 781 | } while (!eos_ && !scan_node_->ReachedLimitShared()); |
| 782 | return Status::OK(); |
| 783 | } |
| 784 | |
| 785 | Status HdfsOrcScanner::GetNextInternal(RowBatch* row_batch) { |
| 786 | if (scan_node_->optimize_count_star()) { |
nothing calls this directly
no test coverage detected