COMMENT Statement

The COMMENT statement adds, changes, or removes a comment about a database, a table, or a column.

You can alternatively use the CREATE and ALTER statements to add comments to the objects.

You can view the comment on a database, a table, or a column using the SHOW or DESCRIBE statement.

Syntax:

COMMENT ON DATABASE db_name IS {'comment' | NULL}
COMMENT ON TABLE [db_name.]table_name IS {'comment' | NULL}
COMMENT ON COLUMN [db_name.]table_name.column_name IS {'comment' | NULL}

Parameters:

  • db_name: Specify the database name if not for the current database.
  • NULL: If given for the comment, removes the existing comment.
  • The comment string can be up to 256 characters long.

Privileges required:

To add a comment, the ALTER privilege on the object is required.

To view a comment, the SELECT, INSERT, or REFRESH on the object is required.

Usage notes:

Added in: Impala 3.1