-
Notifications
You must be signed in to change notification settings - Fork 3k
Core: Validate concurrently added delete files in RowDelta #3195
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
Conversation
| * @param conflictDetectionFilter an expression on rows in the table | ||
| * @return this for method chaining | ||
| */ | ||
| RowDelta conflictDetectionFilter(Expression conflictDetectionFilter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually different from the implementation in PR #3069. I think this one is slightly better as we set the conflict detection filter only once and then enable data/delete file validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, we would need to reason about what happens if the filters are different, which one to use for validating referenced data files, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good to me.
| return (globalDeletes == null || globalDeletes.length == 0) && sortedDeletesByPartition.isEmpty(); | ||
| } | ||
|
|
||
| public List<DeleteFile> referencedDeleteFiles() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would Iterable<DeleteFile> work instead? That would make this lazy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
| protected void validateNoNewDeleteFiles(TableMetadata base, Long startingSnapshotId, | ||
| Expression dataFilter, boolean caseSensitive) { | ||
| // if there is no current table state, no files have been added | ||
| if (base.currentSnapshot() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the check for base.formatVersion() < 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to both methods. Could you check, @rdblue?
|
Looks good. Thanks for adding that check! |
|
Thanks for reviewing, @rdblue! |
This PR validates concurrently added delete files in
BaseRowDelta.