public interface UpdatePartitionSpec extends PendingUpdate<PartitionSpec>
When committing, these changes will be applied to the current table metadata. Commit conflicts
will not be resolved and will result in a CommitFailedException
.
Modifier and Type | Method and Description |
---|---|
UpdatePartitionSpec |
addField(java.lang.String sourceName)
Add a new partition field from a source column.
|
UpdatePartitionSpec |
addField(java.lang.String name,
Term term)
Add a new partition field from an
expression term , with the given partition
field name. |
UpdatePartitionSpec |
addField(Term term)
Add a new partition field from an
expression term . |
UpdatePartitionSpec |
caseSensitive(boolean isCaseSensitive)
Set whether column resolution in the source schema should be case sensitive.
|
UpdatePartitionSpec |
removeField(java.lang.String name)
Remove a partition field by name.
|
UpdatePartitionSpec |
removeField(Term term)
Remove a partition field by its transform
expression term . |
UpdatePartitionSpec |
renameField(java.lang.String name,
java.lang.String newName)
Rename a field in the partition spec.
|
apply, commit, updateEvent
UpdatePartitionSpec caseSensitive(boolean isCaseSensitive)
isCaseSensitive
- whether column resolution should be case sensitiveUpdatePartitionSpec addField(java.lang.String sourceName)
The partition field will be created as an identity partition field for the given source column, with the same name as the source column.
The source column is located using Schema.findField(String)
.
sourceName
- source column name in the table schemajava.lang.IllegalArgumentException
- If the an identity partition field for the source already
exists, or if this change conflicts with other additions, removals, or renames.UpdatePartitionSpec addField(Term term)
expression term
.
The partition field will use the term's transform or the identity transform if the term is a reference.
The term's reference is used to locate the source column using Schema.findField(String)
.
The new partition field will be named for the source column and the transform.
term
- source column name in the table schemajava.lang.IllegalArgumentException
- If the a partition field for the transform and source already
exists, or if this change conflicts with other additions, removals, or renames.UpdatePartitionSpec addField(java.lang.String name, Term term)
expression term
, with the given partition
field name.
The partition field will use the term's transform or the identity transform if the term is a reference.
The term's reference is used to locate the source column using Schema.findField(String)
.
name
- name for the partition fieldterm
- expression for the partition transformjava.lang.IllegalArgumentException
- If the a partition field for the transform and source already
exists, if a partition field with the given name already exists, or if this change
conflicts with other additions, removals, or renames.UpdatePartitionSpec removeField(java.lang.String name)
name
- name of the partition field to removejava.lang.IllegalArgumentException
- If the a partition field with the given name does not exist,
or if this change conflicts with other additions, removals, or renames.UpdatePartitionSpec removeField(Term term)
expression term
.
The partition field with the same transform and source reference will be removed. If the term is a reference and does not have a transform, the identity transform is used.
term
- expression for the partition transform to removejava.lang.IllegalArgumentException
- If the a partition field with the given transform and source
does not exist, or if this change conflicts with other additions, removals, or renames.UpdatePartitionSpec renameField(java.lang.String name, java.lang.String newName)
name
- name of the partition field to renamenewName
- replacement name for the partition fieldjava.lang.IllegalArgumentException
- If name doesn't identify a column in the schema or if this
change conflicts with other additions, removals, or renames.