mc table rename

The mc table rename command renames an Iceberg table on a MinIO AIStor cluster.

You can rename a table within the same namespace or move it to a different namespace using the --to-namespace flag.

The following command renames the table old_table to new_table in the prod namespace of the analytics warehouse on the myaistor MinIO AIStor cluster:

mc table rename myaistor analytics prod old_table new_table

The command has the following syntax:

mc [GLOBALFLAGS] table rename                 \
                 ALIAS                        \
                 WAREHOUSE                    \
                 NAMESPACE                    \
                 OLD_TABLE                    \
                 NEW_TABLE                    \
                 [--to-namespace "string"]
  • Brackets [] indicate optional parameters.
  • Parameters sharing a line are mutually dependent.
  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS

Required

The alias of a MinIO AIStor cluster.

NAMESPACE

Required

The name of the source namespace containing the table to rename.

NEW_TABLE

Required

The new name for the table.

OLD_TABLE

Required

The current name of the table.

WAREHOUSE

Required

The name of the warehouse containing the table.

--to-namespace

Optional

The destination namespace when moving a table to a different namespace. If not specified, the table is renamed within the same namespace.

Global flags

This command supports any of the global flags.

Examples

Rename a table within the same namespace

Use mc table rename to rename a table:

mc table rename ALIAS WAREHOUSE NAMESPACE OLD_TABLE NEW_TABLE
  • Replace ALIAS with the alias of the MinIO AIStor cluster.
  • Replace WAREHOUSE with the name of the warehouse.
  • Replace NAMESPACE with the name of the namespace.
  • Replace OLD_TABLE with the current table name.
  • Replace NEW_TABLE with the new table name.

Move a table to a different namespace

Use the --to-namespace flag to move the table to a different namespace:

mc table rename myaistor analytics dev old_table new_table --to-namespace prod

Rename with JSON output

Use the --json global flag to output the results in JSON format:

mc table rename myaistor analytics prod old_table new_table --json

On this page