luoyuxia commented on code in PR #203:
URL: https://github.com/apache/paimon-rust/pull/203#discussion_r3034918558
##########
crates/paimon/src/table/table_scan.rs:
##########
@@ -134,22 +140,19 @@ fn build_deletion_files_map(
/// The identifier must be rich enough to match Paimon's file identity,
otherwise a delete
/// for one file version can incorrectly remove another with the same file
name.
fn merge_manifest_entries(entries: Vec<ManifestEntry>) -> Vec<ManifestEntry> {
- let mut deleted_entry_keys = HashSet::new();
- let mut added_entries = Vec::new();
-
+ let mut map: IndexMap<Identifier, ManifestEntry> =
IndexMap::with_capacity(entries.len());
Review Comment:
I'm curious why this change is needed.
The previous implementation mostly follows py-paimon. With the current code,
we may read two manifest entries like [Delete(id), Add(id)].
Because manifests are read concurrently, Delete(id) may be observed first.
In that case, the later Add(id) would be kept by the current IndexMap +
shift_remove logic.
However, IIUC, that is incorrect: once Delete(id) exists, the corresponding
Add(id) should be filtered out rather than kept.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]