blob: 00bfc1193c02cf1b8be6c3f355b66aa63435bd2b [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="comment">
<title>COMMENT Statement</title>
<titlealts audience="PDF">
<data name="Category" value="Impala"/>
<data name="Category" value="SQL"/>
<data name="Category" value="DDL"/>
<data name="Category" value="Tables"/>
<data name="Category" value="Hive"/>
<data name="Category" value="Metastore"/>
<data name="Category" value="ETL"/>
<data name="Category" value="Ingest"/>
<data name="Category" value="Developers"/>
<data name="Category" value="Data Analysts"/>
The <codeph>COMMENT</codeph> statement adds, changes, or removes a comment about a
database, a table, or a column.
You can alternatively use the <codeph>CREATE</codeph> and <codeph>ALTER</codeph>
statements to add comments to the objects.
You can view the comment on a database, a table, or a column using the
<codeph>SHOW</codeph> or <codeph>DESCRIBE</codeph> statement.
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
<codeblock>COMMENT ON DATABASE <varname>db_name</varname> IS {'<varname>comment</varname>' | NULL}</codeblock>
<codeblock>COMMENT ON TABLE [<varname>db_name</varname>.]<varname>table_name</varname> IS {'<varname>comment</varname>' | NULL}</codeblock>
<codeblock>COMMENT ON COLUMN [<varname>db_name</varname>.]<varname>table_name</varname>.<varname>column_name</varname> IS {'<varname>comment</varname>' | NULL}</codeblock>
<varname>db_name</varname>: Specify the database name if not for the current database.
<codeph>NULL</codeph>: If given for the comment, removes the existing comment.
The <varname>comment</varname> string can be up to 256 characters long.
<b>Privileges required:</b>
To add a comment, the <codeph>ALTER</codeph> privilege on the object is required.
To view a comment, the <codeph>SELECT</codeph>, <codeph>INSERT</codeph>, or
<codeph>REFRESH</codeph> on the object is required.
<p conref="../shared/impala_common.xml#common/usage_notes_blurb"/>
<b>Added in:</b> <keyword keyref="impala31"/>