-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Core: add row identifier to schema #2465
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
Changes from all commits
bbb1350
4c23cfc
f94486e
b04f664
7d7c4bf
ba503f0
8f52066
5e9393d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,9 @@ | |
|
|
||
| package org.apache.iceberg; | ||
|
|
||
| import java.util.Set; | ||
| import org.apache.iceberg.exceptions.CommitFailedException; | ||
| import org.apache.iceberg.relocated.com.google.common.collect.Sets; | ||
| import org.apache.iceberg.types.Type; | ||
|
|
||
| /** | ||
|
|
@@ -384,4 +386,24 @@ default UpdateSchema updateColumn(String name, Type.PrimitiveType newType, Strin | |
| * with other additions, renames, or updates. | ||
| */ | ||
| UpdateSchema unionByNameWith(Schema newSchema); | ||
|
|
||
| /** | ||
| * Set the identifier fields given a set of field names. | ||
| * See {@link Schema#identifierFieldIds()} to learn more about Iceberg identifier. | ||
| * | ||
| * @param names names of the columns to set as identifier fields | ||
| * @return this for method chaining | ||
| */ | ||
| UpdateSchema setIdentifierFields(Set<String> names); | ||
jackye1995 marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why require this to be a set instead of accepting any
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Technically we can use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to use |
||
|
|
||
| /** | ||
| * Set the identifier fields given some field names. | ||
| * See {@link UpdateSchema#setIdentifierFields(Set)} for more details. | ||
| * | ||
| * @param names names of the columns to set as identifier fields | ||
| * @return this for method chaining | ||
| */ | ||
| default UpdateSchema setIdentifierFields(String... names) { | ||
| return setIdentifierFields(Sets.newHashSet(names)); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.