| 66 | } |
| 67 | |
| 68 | Status PlanRootSink::UpdateAndCheckRowsProducedLimit( |
| 69 | RuntimeState* state, RowBatch* batch) { |
| 70 | // Since the PlanRootSink has a single producer, the |
| 71 | // num_rows_returned_ value can be verified without acquiring any locks. |
| 72 | num_rows_produced_ += batch->num_rows(); |
| 73 | if (num_rows_produced_limit_ > 0 && num_rows_produced_ > num_rows_produced_limit_) { |
| 74 | Status err = Status::Expected(TErrorCode::ROWS_PRODUCED_LIMIT_EXCEEDED, |
| 75 | PrintId(state->query_id()), |
| 76 | PrettyPrinter::Print(num_rows_produced_limit_, TUnit::NONE)); |
| 77 | VLOG_QUERY << err.msg().msg(); |
| 78 | return err; |
| 79 | } |
| 80 | return Status::OK(); |
| 81 | } |
| 82 | } |