Add table_supports_delta_delete property and support delta delete function for Raptor table#13248
Add table_supports_delta_delete property and support delta delete function for Raptor table#13248kewang1024 wants to merge 8 commits intoprestodb:masterfrom
Conversation
|
Does the feature exist already? The PR didn't seem to suggest that. Logically the config to enable the feature should be after the introduction of the feature. If we really want to merge this before the actual feature is available, at least there should not be any release notes. |
adcd26f to
caead97
Compare
So we had an offline discussion that we will be creating a PR to release this feature, and we will have multiple commits. Every commit will be reviewed but not merged. We will be merging the PR after all the commits are finished. @jessesleeping |
caead97 to
faad597
Compare
47dd603 to
c50d21b
Compare
jessesleeping
left a comment
There was a problem hiding this comment.
The first commit LGTM. Some comments other than the inline ones:
- Change the commit message to be more specific. We not only added a column to the metadata, but also added a new table property to gate the feature.
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/StorageManagerConfig.java
Outdated
Show resolved
Hide resolved
...o-raptor/src/main/java/com/facebook/presto/raptor/systemtables/TableMetadataSystemTable.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/test/java/com/facebook/presto/raptor/metadata/TestDatabaseShardManager.java
Outdated
Show resolved
Hide resolved
c50d21b to
b2bec9d
Compare
|
All issues addressed, thanks for the review😄! Will start next commit. |
9399634 to
b52349e
Compare
jessesleeping
left a comment
There was a problem hiding this comment.
Reviewed "Add deltaDeleteEnabled in RaptorSplit". Let's make deltaDeleteEnabled an non-optional member in RaptorSplit.
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/organization/ShardCompactor.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/organization/ShardCompactor.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorSplit.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Reviewed " Add delta_shard_uuid in index table".
Make sure the code refactoring in CREATE table SQL construction doesn't break the previous behavior.
Also, maybe add a comment explaining why every newly created index table will have a delta_shard_uuid column.
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/DatabaseShardManager.java
Outdated
Show resolved
Hide resolved
jessesleeping
left a comment
There was a problem hiding this comment.
Reviewed "Add deltaShardUuid to Raptor split". The current code LGTM but it's incomplete right now as we are lacking the commit logic, which is fine :). We will get there soon.
- We might want to add more tests to
RaptorSplitManageronce we figure out how to commit delta to index table.
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorSplit.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorPageSourceProvider.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorSplitManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/organization/ShardCompactor.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/DatabaseShardManager.java
Outdated
Show resolved
Hide resolved
I agree, will add more tests once the whole logic is through |
4da0984 to
518bb55
Compare
4355801 to
2d017d6
Compare
4196973 to
90a769d
Compare
jessesleeping
left a comment
There was a problem hiding this comment.
Reviewed all none test code.
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardDao.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardManager.java
Outdated
Show resolved
Hide resolved
...to-raptor/src/main/java/com/facebook/presto/raptor/storage/organization/OrganizationJob.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/facebook/presto/raptor/storage/organization/ShardOrganizationManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/DatabaseShardManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/DatabaseShardManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcStorageManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcPageSource.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcPageSource.java
Outdated
Show resolved
Hide resolved
2a85f23 to
f954308
Compare
highker
left a comment
There was a problem hiding this comment.
Some early comments. Haven't started compactor or rewriter parts yet
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorMetadata.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorTableProperties.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/StorageManagerConfig.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorPageSourceProvider.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorPageSourceProvider.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcStorageManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcStorageManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcStorageManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/InplaceShardRewriter.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/DeltaShardRewriter.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/DeltaShardRewriter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
This new OrcReader method seems to be used quite often; can we make it a helper in a util?
There was a problem hiding this comment.
- Use
elsefor the following branch - remove
return - move
clearRollback();to the end
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorSplitManager.java
Outdated
Show resolved
Hide resolved
f954308 to
5c34161
Compare
bce2641 to
8b35637
Compare
|
All the issues addressed except for the delta format. In order to make review easier, most of the newly added code is in new commits, except some bugs and rebase conflicts are merged into old commits. @jessesleeping will commit the data verification logic, so it's not included here yet. |
highker
left a comment
There was a problem hiding this comment.
"Enable create table with table_supports_delta_delete properties" minor comments
- The commit message body is too wide. Keep each line within 72 characters.
- I would suggest sending out different PRs for each commit. The PR is too large to merge at once.
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardManager.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
We don't need a config to flag the table property. Just make it false.
There was a problem hiding this comment.
We don't need a config to flag the table property. Just make it false.
According to the early discussion, we want to have the ability to control the default behavior of all the table newly created, instead of making it a manual operation.
Besides, this feature is a good to have, then maybe we don't need to remove it
presto-raptor/src/test/java/com/facebook/presto/raptor/metadata/TestDatabaseShardManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/test/java/com/facebook/presto/raptor/metadata/TestDatabaseShardManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/test/java/com/facebook/presto/raptor/metadata/TestRaptorMetadata.java
Outdated
Show resolved
Hide resolved
highker
left a comment
There was a problem hiding this comment.
"Add tableSupportsDeltaDelete and deltaShardUuid in RaptorSplit": Let's make sure the commit message body is within 72 chars
There was a problem hiding this comment.
We don't need this flag if we can use Optional.empty for deltaShardUuid
There was a problem hiding this comment.
We don't need this flag if we can use
Optional.emptyfordeltaShardUuid
According to the discussion with Jiexi, the design is that we have a table property indicating if this table supports delta_delete. But in the future, we could have the concept of delta_delete as session property.
Thus having these two parameters give us the flexibility and compatibility to future features.
That's why I didn't fix it for last comment, sorry that I didn't explain last time.
There was a problem hiding this comment.
move boolean tableSupportsDeltaDelete to the end
There was a problem hiding this comment.
Same reason as above.
presto-raptor/src/main/java/com/facebook/presto/raptor/metadata/ShardIterator.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/organization/ShardCompactor.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/organization/ShardCompactor.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcPageSource.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorSplitManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorSplitManager.java
Outdated
Show resolved
Hide resolved
presto-raptor/src/main/java/com/facebook/presto/raptor/storage/OrcFileRewriter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
The following three fields are confusing. I assume we only need a BitSet to denote what rows to delete and a flag tableSupportsDeltaDelete to denote what kind of delete we wanna apply?
|
As @highker suggested, this PR is too large, thus splitting to three PRs. |
8b35637 to
74a170b
Compare
74a170b to
c20a31c
Compare

== RELEASE NOTES ==
Raptor Changes