Class TableChange.RenameColumn

java.lang.Object
org.apache.gravitino.rel.TableChange.RenameColumn
All Implemented Interfaces:
TableChange, TableChange.ColumnChange
Enclosing interface:
TableChange

public static final class TableChange.RenameColumn extends Object implements TableChange.ColumnChange
A TableChange to rename a field.

The name is used to find the field to rename. The new name will replace the leaf field name. For example, renameColumn("a.b.c", "x") should produce column a.b.x.

If the field does not exist, the change must result in an IllegalArgumentException.

  • Method Details

    • getFieldName

      public String[] getFieldName()
      Retrieves the hierarchical field name of the column to be renamed.
      Returns:
      An array of strings representing the field name.
    • getNewName

      public String getNewName()
      Retrieves the new name for the column.
      Returns:
      The new name of the column.
    • equals

      public boolean equals(Object o)
      Compares this RenameColumn instance with another object for equality. The comparison is based on the field name array and the new name.
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare with this instance.
      Returns:
      true if the given object represents the same column renaming; false otherwise.
    • hashCode

      public int hashCode()
      Generates a hash code for this RenameColumn instance. This hash code is based on both the hierarchical field name and the new name.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code value for this column renaming operation.
    • fieldName

      public String[] fieldName()
      Description copied from interface: TableChange.ColumnChange
      Retrieves the field name of the column to be modified.
      Specified by:
      fieldName in interface TableChange.ColumnChange
      Returns:
      An array of strings representing the field name.