Skip to content

Commit

Permalink
exploit the sorted property of (positional) delete files, reducing th…
Browse files Browse the repository at this point in the history
…e amount of lookups in the unordered_map
  • Loading branch information
Tishj committed Feb 28, 2025
1 parent 573ac59 commit c15d301
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/iceberg_functions/iceberg_multi_file_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,23 @@ void IcebergMultiFileList::ScanDeleteFile(const string &delete_file_path) const

auto names = FlatVector::GetData<string_t>(result.data[0]);
auto row_ids = FlatVector::GetData<int64_t>(result.data[1]);

if (count == 0) {
continue;
}
reference<string_t> current_file_path = names[0];
reference<IcebergDeleteData> deletes = delete_data[current_file_path.get().GetString()];

for (idx_t i = 0; i < count; i++) {
auto &name = names[i];
auto &row_id = row_ids[i];

auto &deletes = delete_data[name.GetString()];
deletes.AddRow(row_id);
if (name != current_file_path.get()) {
current_file_path = name;
deletes = delete_data[current_file_path.get().GetString()];
}

deletes.get().AddRow(row_id);
}
} while (result.size() != 0);
}
Expand Down

0 comments on commit c15d301

Please sign in to comment.