Package org.apache.flink.table.catalog
Class TableChange.ModifyColumn
- java.lang.Object
-
- org.apache.flink.table.catalog.TableChange.ModifyColumn
-
- All Implemented Interfaces:
TableChange
- Direct Known Subclasses:
TableChange.ModifyColumnComment
,TableChange.ModifyColumnName
,TableChange.ModifyColumnPosition
,TableChange.ModifyPhysicalColumnType
- Enclosing interface:
- TableChange
@PublicEvolving public static class TableChange.ModifyColumn extends Object implements TableChange
A base schema change to modify a column. The modification includes:- change column data type
- reorder column position
- modify column comment
- rename column name
- change the computed expression
- change the metadata column expression
Some fine-grained column changes are defined in the
TableChange.ModifyPhysicalColumnType
,TableChange.ModifyColumnComment
,TableChange.ModifyColumnPosition
andTableChange.ModifyColumnName
.It is equal to the following statement:
ALTER TABLE <table_name> MODIFY <column_definition> COMMENT '<column_comment>' <column_position>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.TableChange
TableChange.AddColumn, TableChange.AddDistribution, TableChange.AddUniqueConstraint, TableChange.AddWatermark, TableChange.After, TableChange.ColumnPosition, TableChange.DropColumn, TableChange.DropConstraint, TableChange.DropDistribution, TableChange.DropWatermark, TableChange.First, TableChange.MaterializedTableChange, TableChange.ModifyColumn, TableChange.ModifyColumnComment, TableChange.ModifyColumnName, TableChange.ModifyColumnPosition, TableChange.ModifyDistribution, TableChange.ModifyPhysicalColumnType, TableChange.ModifyRefreshHandler, TableChange.ModifyRefreshStatus, TableChange.ModifyUniqueConstraint, TableChange.ModifyWatermark, TableChange.ResetOption, TableChange.SetOption
-
-
Field Summary
Fields Modifier and Type Field Description protected Column
newColumn
protected TableChange.ColumnPosition
newPosition
protected Column
oldColumn
-
Constructor Summary
Constructors Constructor Description ModifyColumn(Column oldColumn, Column newColumn, TableChange.ColumnPosition newPosition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Column
getNewColumn()
Returns the modifiedColumn
instance.TableChange.ColumnPosition
getNewPosition()
Returns the position of the modifiedColumn
instance.Column
getOldColumn()
Returns the originalColumn
instance.int
hashCode()
String
toString()
-
-
-
Field Detail
-
oldColumn
protected final Column oldColumn
-
newColumn
protected final Column newColumn
-
newPosition
@Nullable protected final TableChange.ColumnPosition newPosition
-
-
Constructor Detail
-
ModifyColumn
public ModifyColumn(Column oldColumn, Column newColumn, @Nullable TableChange.ColumnPosition newPosition)
-
-
Method Detail
-
getNewPosition
@Nullable public TableChange.ColumnPosition getNewPosition()
Returns the position of the modifiedColumn
instance. When the return value is null, it means modify the column at the original position. When the return value is FIRST, it means move the modified column to the first. When the return value is AFTER, it means move the column after the referred column.
-
-