@InterfaceAudience.Public @InterfaceStability.Unstable public class AlterTableOptions extends Object
Constructor and Description |
---|
AlterTableOptions() |
Modifier and Type | Method and Description |
---|---|
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, thus has no default value.
|
AlterTableOptions |
dropColumn(String name)
Drop a column.
|
AlterTableOptions |
renameColumn(String oldName,
String newName)
Change the name of a column.
|
AlterTableOptions |
renameTable(String newName)
Change a table's name.
|
public AlterTableOptions renameTable(String newName)
newName
- new table's name, must be used to check progresspublic 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 dropColumn(String name)
name
- name of the columnpublic AlterTableOptions renameColumn(String oldName, String newName)
oldName
- old column's name, must existnewName
- new name to useCopyright © 2015. All rights reserved.