@InterfaceAudience.Public @InterfaceStability.Unstable public class AlterTableOptions extends Object
Constructor and Description |
---|
AlterTableOptions() |
Modifier and Type | Method and Description |
---|---|
AlterTableOptions |
addColumn(ColumnSchema colSchema)
Add a new column.
|
AlterTableOptions |
addColumn(String name,
Type type,
Object defaultVal)
Add a new column that's not nullable.
|
AlterTableOptions |
addNullableColumn(String name,
Type type)
Add a new column that's nullable and has no default value.
|
AlterTableOptions |
addNullableColumn(String name,
Type type,
Object defaultVal)
Add a new column that's nullable.
|
AlterTableOptions |
addRangePartition(PartialRow lowerBound,
PartialRow upperBound)
Add a range partition to the table with an inclusive lower bound and an exclusive upper bound.
|
AlterTableOptions |
addRangePartition(PartialRow lowerBound,
PartialRow upperBound,
RangePartitionBound lowerBoundType,
RangePartitionBound upperBoundType)
Add a range partition to the table with a lower bound and upper bound.
|
AlterTableOptions |
addRangePartition(PartialRow lowerBound,
PartialRow upperBound,
String dimensionLabel,
RangePartitionBound lowerBoundType,
RangePartitionBound upperBoundType)
Add a range partition to the table with dimension label.
|
AlterTableOptions |
alterExtraConfigs(Map<String,String> extraConfig)
Change the table's extra configuration properties.
|
AlterTableOptions |
changeComment(String name,
String comment)
Change the comment for the column.
|
AlterTableOptions |
changeCompressionAlgorithm(String name,
ColumnSchema.CompressionAlgorithm ca)
Change the compression used for a column.
|
AlterTableOptions |
changeDefault(String name,
Object newDefault)
Change the default value for a column.
|
AlterTableOptions |
changeDesiredBlockSize(String name,
int blockSize)
Change the block size of a column's storage.
|
AlterTableOptions |
changeEncoding(String name,
ColumnSchema.Encoding encoding)
Change the encoding used for a column.
|
AlterTableOptions |
dropColumn(String name)
Drop a column.
|
AlterTableOptions |
dropRangePartition(PartialRow lowerBound,
PartialRow upperBound)
Drop the range partition from the table with the specified inclusive lower bound and exclusive
upper bound.
|
AlterTableOptions |
dropRangePartition(PartialRow lowerBound,
PartialRow upperBound,
RangePartitionBound lowerBoundType,
RangePartitionBound upperBoundType)
Drop the range partition from the table with the specified lower bound and upper bound.
|
AlterTableOptions |
removeDefault(String name)
Remove the default value for a column.
|
AlterTableOptions |
renameColumn(String oldName,
String newName)
Change the name of a column.
|
AlterTableOptions |
renameTable(String newName)
Change a table's name.
|
AlterTableOptions |
setOwner(String owner)
Change a table's owner.
|
AlterTableOptions |
setWait(boolean wait)
Whether to wait for the table to be fully altered before this alter
operation is considered to be finished.
|
public AlterTableOptions renameTable(String newName)
newName
- new table's name, must be used to check progresspublic AlterTableOptions setOwner(String owner)
owner
- the new table ownerpublic AlterTableOptions addColumn(ColumnSchema colSchema)
colSchema
- the schema of the new columnpublic AlterTableOptions addColumn(String name, Type type, Object defaultVal)
name
- name of the new columntype
- type of the new columndefaultVal
- default value used for the currently existing rowspublic AlterTableOptions addNullableColumn(String name, Type type)
name
- name of the new columntype
- type of the new columnpublic AlterTableOptions addNullableColumn(String name, Type type, Object defaultVal)
name
- name of the new columntype
- type of the new columndefaultVal
- the default value of the new columnpublic AlterTableOptions dropColumn(String name)
name
- name of the columnpublic AlterTableOptions renameColumn(String oldName, String newName)
oldName
- old column's name, must existnewName
- new name to usepublic AlterTableOptions removeDefault(String name)
name
- name of the columnpublic AlterTableOptions changeDefault(String name, Object newDefault)
IllegalArgumentException
.name
- name of the columnnewDefault
- the new default valuepublic AlterTableOptions changeDesiredBlockSize(String name, int blockSize)
name
- name of the columnblockSize
- the new block sizepublic AlterTableOptions changeEncoding(String name, ColumnSchema.Encoding encoding)
name
- name of the columnencoding
- the new encodingpublic AlterTableOptions changeCompressionAlgorithm(String name, ColumnSchema.CompressionAlgorithm ca)
name
- the name of the columnca
- the new compression algorithmpublic AlterTableOptions addRangePartition(PartialRow lowerBound, PartialRow upperBound)
lowerBound
- inclusive lower bound, may be empty but not nullupperBound
- exclusive upper bound, may be empty but not nullpublic AlterTableOptions addRangePartition(PartialRow lowerBound, PartialRow upperBound, RangePartitionBound lowerBoundType, RangePartitionBound upperBoundType)
lowerBound
- lower bound, may be empty but not nullupperBound
- upper bound, may be empty but not nulllowerBoundType
- the type of the lower bound, either inclusive or exclusiveupperBoundType
- the type of the upper bound, either inclusive or exclusivepublic AlterTableOptions addRangePartition(PartialRow lowerBound, PartialRow upperBound, String dimensionLabel, RangePartitionBound lowerBoundType, RangePartitionBound upperBoundType)
lowerBound
- lower bound, may be empty but not nullupperBound
- upper bound, may be empty but not nulldimensionLabel
- the dimension label for the tablet to be createdlowerBoundType
- the type of the lower bound, either inclusive or exclusiveupperBoundType
- the type of the upper bound, either inclusive or exclusivepublic AlterTableOptions dropRangePartition(PartialRow lowerBound, PartialRow upperBound)
lowerBound
- inclusive lower bound, can be empty but not nullupperBound
- exclusive upper bound, can be empty but not nullpublic AlterTableOptions dropRangePartition(PartialRow lowerBound, PartialRow upperBound, RangePartitionBound lowerBoundType, RangePartitionBound upperBoundType)
lowerBound
- inclusive lower bound, can be empty but not nullupperBound
- exclusive upper bound, can be empty but not nulllowerBoundType
- the type of the lower bound, either inclusive or exclusiveupperBoundType
- the type of the upper bound, either inclusive or exclusivepublic AlterTableOptions changeComment(String name, String comment)
name
- name of the columncomment
- the new comment for the column, an empty comment means
deleting an existing comment.public AlterTableOptions alterExtraConfigs(Map<String,String> extraConfig)
extraConfig
- the table's extra configuration propertiespublic AlterTableOptions setWait(boolean wait)
If false, the alter will finish quickly, but a subsequent
KuduClient.openTable(String)
may return a KuduTable
with
an out-of-date schema.
If true, the alter will take longer, but the very next schema is guaranteed to be up-to-date.
If not provided, defaults to true.
wait
- whether to wait for the table to be fully altered