| 166 | } |
| 167 | |
| 168 | Status SubplanNode::Reset(RuntimeState* state, RowBatch* row_batch) { |
| 169 | input_batch_->TransferResourceOwnership(row_batch); |
| 170 | input_eos_ = false; |
| 171 | input_row_idx_ = 0; |
| 172 | subplan_eos_ = false; |
| 173 | SetNumRowsReturned(0); |
| 174 | RETURN_IF_ERROR(child(0)->Reset(state, row_batch)); |
| 175 | // If child(1) is not open it means that we have just Reset() it and returned from |
| 176 | // GetNext() without opening it again. It is not safe to call Reset() on the same |
| 177 | // exec node twice in a row. |
| 178 | if (subplan_is_open_) RETURN_IF_ERROR(child(1)->Reset(state, row_batch)); |
| 179 | return Status::OK(); |
| 180 | } |
| 181 | |
| 182 | void SubplanNode::Close(RuntimeState* state) { |
| 183 | if (is_closed()) return; |
no test coverage detected