| 499 | } |
| 500 | |
| 501 | bool ExecNode::CheckLimitAndTruncateRowBatchIfNeeded(RowBatch* row_batch, bool* eos) { |
| 502 | DCHECK(limit_ != 0); |
| 503 | const int row_batch_size = row_batch->num_rows(); |
| 504 | const bool reached_limit = |
| 505 | !(limit_ == -1 || (rows_returned() + row_batch_size) < limit_); |
| 506 | const int num_rows_to_consume = |
| 507 | !reached_limit ? row_batch_size : limit_ - rows_returned(); |
| 508 | IncrementNumRowsReturned(num_rows_to_consume); |
| 509 | if (reached_limit) { |
| 510 | row_batch->set_num_rows(num_rows_to_consume); |
| 511 | *eos = true; |
| 512 | } |
| 513 | return reached_limit; |
| 514 | } |
| 515 | |
| 516 | bool ExecNode::CheckLimitAndTruncateRowBatchIfNeededShared( |
| 517 | RowBatch* row_batch, bool* eos) { |
nothing calls this directly
no test coverage detected