-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark: Supports creating a branch on an empty table #8072
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
|
Hi @rdblue @jackye1995, I see you have discussed this at here #7075, could you help to review this when you are free? Thanks a lot. |
|
+1 for this change. This will solve this issue #7593 at its root. |
.palantir/revapi.yml
Outdated
| "1.3.0": | ||
| org.apache.iceberg:iceberg-api: | ||
| - code: "java.method.addedToInterface" | ||
| new: "method org.apache.iceberg.ManageSnapshots org.apache.iceberg.ManageSnapshots::createBranch(java.lang.String)" |
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.
I don't think we want to break the API just by adding a new method. Rather than breaking the API, we typically add a default implementation that throws an UOE, similar to how it's done in Snapshot#removedDeleteFiles
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.
Thanks @nastra, updated.
e267ac3 to
d55339f
Compare
|
@nastra would you mind taking a look at this again? Thanks a lot. |
|
@amogh-jahagirdar and @jackye1995, FYI |
| * | ||
| * @param name branch name | ||
| * @return this for method chaining | ||
| * @throws IllegalArgumentException if a branch with the given name already exists |
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 be nice to have a test for this.
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.
Let me do a follow-up.
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.
|
Thanks, @ConeyLiu! |
|
Thanks @rdblue for merging this. And also thanks @nastra @zhangbutao for reviewing. |
This change backports PR #8072 to Spark 3.1, 3.2, 3.3. Co-authored-by: xianyangliu <[email protected]>
Currently, we only support creating branches with a given snapshot ID. However, there is no snapshot for an empty table. This PR achieves this by creating a newly empty snapshot for an empty table. And binding the branch to the new snapshot.