| 184 | } |
| 185 | |
| 186 | Status NljBuilder::Send(RuntimeState* state, RowBatch* batch) { |
| 187 | SCOPED_TIMER(profile()->total_time_counter()); |
| 188 | int num_input_rows = batch->num_rows(); |
| 189 | // Swap the contents of the batch into a batch owned by the builder. |
| 190 | RowBatch* build_batch = GetNextEmptyBatch(); |
| 191 | build_batch->AcquireState(batch); |
| 192 | |
| 193 | AddBuildBatch(build_batch); |
| 194 | if (is_separate_build_ |
| 195 | || build_batch->flush_mode() == RowBatch::FlushMode::FLUSH_RESOURCES |
| 196 | || build_batch->num_buffers() > 0) { |
| 197 | // This batch and earlier batches may refer to resources passed from the child |
| 198 | // that aren't owned by the row batch itself. Deep copying ensures that the row |
| 199 | // batches are backed by memory owned by this node that is safe to hold on to. |
| 200 | // |
| 201 | // Acquiring ownership of attached Blocks or Buffers does not correctly update the |
| 202 | // accounting, so also copy data in that cases to avoid stealing reservation |
| 203 | // from whoever created the Block/Buffer. TODO: remove workaround when IMPALA-4179 |
| 204 | // is fixed. |
| 205 | RETURN_IF_ERROR(DeepCopyBuildBatches(state)); |
| 206 | } |
| 207 | COUNTER_ADD(num_build_rows_, num_input_rows); |
| 208 | return Status::OK(); |
| 209 | } |
| 210 | |
| 211 | Status NljBuilder::FlushFinal(RuntimeState* state) { |
| 212 | SCOPED_TIMER(profile()->total_time_counter()); |
nothing calls this directly
no test coverage detected