| 187 | } |
| 188 | |
| 189 | Status UnionNode::GetNextPassThrough(RuntimeState* state, RowBatch* row_batch) { |
| 190 | DCHECK(!ReachedLimit()); |
| 191 | DCHECK(!IsInSubplan()); |
| 192 | DCHECK_LT(child_idx_, children_.size()); |
| 193 | DCHECK(IsChildPassthrough(child_idx_)); |
| 194 | DCHECK(child(child_idx_)->row_desc()->LayoutEquals(*row_batch->row_desc())); |
| 195 | if (child_eos_) RETURN_IF_ERROR(child(child_idx_)->Open(state)); |
| 196 | DCHECK_EQ(row_batch->num_rows(), 0); |
| 197 | RETURN_IF_ERROR(child(child_idx_)->GetNext(state, row_batch, &child_eos_)); |
| 198 | if (child_eos_) { |
| 199 | // Even though the child is at eos, it's not OK to Close() it here. Once we close |
| 200 | // the child, the row batches that it produced are invalid. Marking the batch as |
| 201 | // needing a deep copy let's us safely close the child in the next GetNext() call. |
| 202 | // TODO: Remove this as part of IMPALA-4179. |
| 203 | row_batch->MarkNeedsDeepCopy(); |
| 204 | to_close_child_idx_ = child_idx_; |
| 205 | ++child_idx_; |
| 206 | } |
| 207 | return Status::OK(); |
| 208 | } |
| 209 | |
| 210 | Status UnionNode::GetNextMaterialized(RuntimeState* state, RowBatch* row_batch) { |
| 211 | // Fetch from children, evaluate corresponding exprs and materialize. |
nothing calls this directly
no test coverage detected