gravitino.api.rel.table_change.AddColumn¶
- final class gravitino.api.rel.table_change.AddColumn(_field_name: list[str], _data_type: Type, _comment: str | None = None, _position: ColumnPosition | None = None, _nullable: bool = True, _auto_increment: bool = False, _default_value: Expression | None = None)¶
Bases:
ColumnChangeA 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.
- __init__(_field_name: list[str], _data_type: Type, _comment: str | None = None, _position: ColumnPosition | None = None, _nullable: bool = True, _auto_increment: bool = False, _default_value: Expression | None = None) None¶
Methods
__init__(_field_name, _data_type[, ...])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.
Retrieves the field name of the new column.
Retrieves the position where the new column should be added.
Checks if the new column is auto-increment.
Checks if the new column is nullable.
- field_name() list[str]¶
Retrieves the field name of the column to be modified.
- Returns:
- list[str]:
A list of strings representing the field name.
- get_comment() str | None¶
Retrieves the comment for the new column.
- Returns:
str: comment for the new column.
- get_data_type() Type¶
Retrieves the data type of the new column.
- Returns:
Type: The data type of the new column.
- get_default_value() Expression¶
Retrieves the default value of the new column.
- Returns:
Expression: The default value of the column.
- get_field_name() list[str]¶
Retrieves the field name of the new column.
- Returns:
list[str]: The field name of the new column.
- get_position() ColumnPosition | None¶
Retrieves the position where the new column should be added.
- Returns:
- TableChange.ColumnPosition:
The position of the column.
- is_auto_increment() bool¶
Checks if the new column is auto-increment.
- Returns:
bool: True if the column is auto-increment; False otherwise.
- is_nullable() bool¶
Checks if the new column is nullable.
- Returns:
bool: True if the column is nullable; False otherwise.