| 304 | } |
| 305 | |
| 306 | Status IcebergDeleteBuilder::AddToDeletedRows(const StringValue& path, |
| 307 | const vector<uint64_t>& positions) { |
| 308 | auto it = deleted_rows_.find(path); |
| 309 | if (LIKELY(it != deleted_rows_.end())) { |
| 310 | RoaringBitmap64& deletes = it->second; |
| 311 | deletes.AddElements(positions); |
| 312 | } else if (path.Len() == 0) { |
| 313 | return Status("NULL found as file_path in delete file"); |
| 314 | } else { |
| 315 | // We received a path of a data file that is not scheduled for this fragment. |
| 316 | if (is_separate_build_) { |
| 317 | // When the build is in its own fragment we assume that delete records are filtered |
| 318 | // in the sender by DIRECTED distribution mode. Therefore we should never see |
| 319 | // dangling delete records. |
| 320 | stringstream ss; |
| 321 | ss << "Invalid file path arrived at builder: " << path << " Paths expected: ["; |
| 322 | for (auto& [vec_path, unused] : deleted_rows_) { |
| 323 | ss << vec_path << ", "; |
| 324 | } |
| 325 | ss << "]"; |
| 326 | return Status(ss.str()); |
| 327 | } |
| 328 | } |
| 329 | return Status::OK(); |
| 330 | } |
| 331 | |
| 332 | Status IcebergDeleteBuilder::ProcessBuildBatch(RuntimeState* state, |
| 333 | RowBatch* build_batch) { |