| 330 | } |
| 331 | |
| 332 | Status IcebergDeleteBuilder::ProcessBuildBatch(RuntimeState* state, |
| 333 | RowBatch* build_batch) { |
| 334 | if (UNLIKELY(build_batch->num_rows() == 0)) return Status::OK(); |
| 335 | |
| 336 | TupleRow* first_row = build_batch->GetRow(0); |
| 337 | impala::StringValue* file_path = |
| 338 | first_row->GetTuple(0)->GetStringSlot(file_path_offset_); |
| 339 | uint64_t pos = *first_row->GetTuple(0)->GetBigIntSlot(pos_offset_); |
| 340 | |
| 341 | StringValue prev_file_path(*file_path); |
| 342 | vector<uint64_t> pos_buffer; |
| 343 | pos_buffer.reserve(128); |
| 344 | pos_buffer.push_back(pos); |
| 345 | |
| 346 | FOREACH_ROW(build_batch, 1, build_batch_iter) { |
| 347 | TupleRow* build_row = build_batch_iter.Get(); |
| 348 | |
| 349 | file_path = build_row->GetTuple(0)->GetStringSlot(file_path_offset_); |
| 350 | pos = *build_row->GetTuple(0)->GetBigIntSlot(pos_offset_); |
| 351 | |
| 352 | if (file_path->Ptr() == prev_file_path.Ptr() || *file_path == prev_file_path) { |
| 353 | pos_buffer.push_back(pos); |
| 354 | } else { |
| 355 | RETURN_IF_ERROR(AddToDeletedRows(prev_file_path, pos_buffer)); |
| 356 | pos_buffer.clear(); |
| 357 | pos_buffer.push_back(pos); |
| 358 | prev_file_path.Assign(*file_path); |
| 359 | } |
| 360 | } |
| 361 | RETURN_IF_ERROR(AddToDeletedRows(prev_file_path, pos_buffer)); |
| 362 | |
| 363 | return Status::OK(); |
| 364 | } |
nothing calls this directly
no test coverage detected