Package org.apache.gravitino.rel
Class TableChange.AddColumn
java.lang.Object
org.apache.gravitino.rel.TableChange.AddColumn
- All Implemented Interfaces:
TableChange
,TableChange.ColumnChange
- Enclosing interface:
- TableChange
A TableChange to add a field. The implementation may need to back-fill all the existing data to
add this new column, or remember the column default value specified here and let the reader
fill the column value when reading existing data that do not have this new column.
If the field already exists, the change must result in an IllegalArgumentException
.
If the new field is nested and its parent does not exist or is not a struct, the change must
result in an IllegalArgumentException
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.gravitino.rel.TableChange
TableChange.AddColumn, TableChange.AddIndex, TableChange.After, TableChange.ColumnChange, TableChange.ColumnPosition, TableChange.Default, TableChange.DeleteColumn, TableChange.DeleteIndex, TableChange.First, TableChange.RemoveProperty, TableChange.RenameColumn, TableChange.RenameTable, TableChange.SetProperty, TableChange.UpdateColumnAutoIncrement, TableChange.UpdateColumnComment, TableChange.UpdateColumnDefaultValue, TableChange.UpdateColumnNullability, TableChange.UpdateColumnPosition, TableChange.UpdateColumnType, TableChange.UpdateComment
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares this AddColumn instance with another object for equality.String[]
Retrieves the field name of the column to be modified.Retrieves the comment for the new column.Retrieves the data type of the new column.Retrieves the default value of the new column.String[]
Retrieves the field name of the new column.Retrieves the position where the new column should be added.int
hashCode()
Generates a hash code for this AddColumn instance.boolean
Checks if the new column is autoIncrement.boolean
Checks if the new column is nullable.
-
Method Details
-
getFieldName
Retrieves the field name of the new column.- Returns:
- An array of strings representing the field name.
-
getDataType
Retrieves the data type of the new column.- Returns:
- The data type of the column.
-
getComment
Retrieves the comment for the new column.- Returns:
- The comment associated with the column.
-
getPosition
Retrieves the position where the new column should be added.- Returns:
- The position of the column.
-
isNullable
public boolean isNullable()Checks if the new column is nullable.- Returns:
- true if the column is nullable; false otherwise.
-
isAutoIncrement
public boolean isAutoIncrement()Checks if the new column is autoIncrement.- Returns:
- true if the column is autoIncrement; false otherwise.
-
getDefaultValue
Retrieves the default value of the new column.- Returns:
- The default value of the column.
-
equals
Compares this AddColumn instance with another object for equality. The comparison is based on the field name, data type, comment, position, and nullability. -
hashCode
public int hashCode()Generates a hash code for this AddColumn instance. This hash code is based on the field name, data type, comment, position, nullability, and autoIncrement. -
fieldName
Description copied from interface:TableChange.ColumnChange
Retrieves the field name of the column to be modified.- Specified by:
fieldName
in interfaceTableChange.ColumnChange
- Returns:
- An array of strings representing the field name.
-