Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] introduce deletedIndexFiles in IndexIncrement and allow multi … #3368

Merged
merged 7 commits into from
May 22, 2024

Conversation

YannByron
Copy link
Contributor

…index files in the same partition and bucket

Purpose

Linked issue: close #xxx

Tests

API and Format

Documentation

…index files in the same partition and bucket
public Map<String, DeletionVector> readAllDeletionVectors(IndexFileMeta fileMeta) {
LinkedHashMap<String, Pair<Integer, Integer>> deletionVectorRanges =
fileMeta.deletionVectorsRanges();
if (deletionVectorRanges == null || deletionVectorRanges.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file be deleted? Why should handle here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, this IndexFileMeta must be Deletion_Vector Index, and ranges is not empty. Can remove this part.

}
}

/** We combine the previous and new index files by {@link IndexManifestEntry#identifier}. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just move IndexManifestEntry#identifier to here? Actually it is not identifier now. It is only for non-UnawareBucket table.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method can remove here.

List<IndexManifestEntry> prevIndexFiles, List<IndexManifestEntry> newIndexFiles) {
Map<IndexManifestEntry.Identifier, IndexManifestEntry> indexEntries =
prevIndexFiles.stream()
.filter(entry -> entry.kind() == FileKind.ADD)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevIndexFiles should has not delete files. here just checkArguement?
(maybe you can assert outside)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.

List<IndexManifestEntry> prevIndexFiles, List<IndexManifestEntry> newIndexFiles) {
Map<String, IndexManifestEntry> indexEntries = new LinkedHashMap<>();
for (IndexManifestEntry entry : prevIndexFiles) {
if (entry.kind() == FileKind.ADD) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevIndexFiles should has not delete files. here just checkArguement?
(maybe you can assert outside)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. all the prevIndexFiles should be FileKind.ADD.

Map<String, IndexManifestEntry> indexEntries = new LinkedHashMap<>();
for (IndexManifestEntry entry : prevIndexFiles) {
if (entry.kind() == FileKind.ADD) {
indexEntries.put(entry.indexFile().fileName(), entry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using deletionVectorsRanges?

I think fileName is wrong key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be used in both Hash and Deletion_Vector index files.

@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit e8acd22 into apache:master May 22, 2024
9 checks passed
sunxiaojian pushed a commit to sunxiaojian/paimon that referenced this pull request May 28, 2024
joyCurry30 pushed a commit to joyCurry30/paimon that referenced this pull request May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants