Adicione comentários aos dados e AI ativo
Este artigo apresenta comentários para dados e AI ativo e explica como adicioná-los. Os comentários podem ajudar o senhor e outros usuários a encontrar e gerenciar os dados e o AI ativo de que precisa.
Os comentários fornecem um campo de metadados para anotar seus objetos protegíveis. O senhor pode adicionar comentários a qualquer objeto seguro em Unity Catalog, como catálogos, esquemas, tabelas, volumes, modelos AI e outros. Você também pode adicionar comentários às colunas da tabela.
O senhor pode adicionar comentários manualmente ou permitir que o site Databricks crie comentários gerados pelo AIpara o senhor. AIOs comentários gerados (também conhecidos como AI-generated documentation) estão disponíveis para tabelas e colunas de tabelas. Consulte Adicionar AIcomentários gerados pelo Unity Catalog site aos objetos.
Quando o senhor modifica os comentários de uma tabela Unity Catalog (ou uma tabela Delta Lake no legado Hive metastore), uma operação SET TBLPROPERTIES
no histórico da tabela registra a consulta SQL que foi usada para definir o comentário da tabela.
Antes de começar
Você deve atender aos seguintes requisitos para adicionar ou editar comentários:
-
Para adicionar ou editar comentários em um catálogo, esquema, volume, modelo, compartilhamento, destinatário, provedor, credencial de armazenamento, localização externa ou conexão, você deve ser o proprietário do objeto ou ter o privilégio
MANAGE
no objeto. -
Para adicionar ou editar comentários em uma tabela ou coluna, você deve ser o proprietário ou ter os seguintes privilégios:
MODIFY
eSELECT
na mesa.USE CATALOG
eUSE SCHEMA
no catálogo e esquema principais.
-
O senhor deve usar um SQL warehouse ou outro compute que suporte Unity Catalog.
-
Para usar AI-generated comments, seu workspace deve estar habilitado para AI-assistive recurso. Consulte Adicionar AIcomentários gerados pelo Unity Catalog site aos objetos.
Adicionar e editar comentários
O senhor pode adicionar comentários a objetos protegidos ou editá-los usando o SQL comando ou o Catalog Explorer.
- Catalog Explorer
- SQL
Saving comments triggers an ALTER
SQL command, which can disrupt Databricks pipelines and jobs.
-
In the workspace sidebar, click
Catalog to open Catalog Explorer.
-
Search for and select the object you want to comment on.
Data and AI objects are listed and searchable in the Catalog pane. Shares, storage credentials, external locations, and connections are accessible using the menu that opens when you click the
gear icon.
-
Add a comment or edit an existing comment.
- To add a comment to a table using AI-generated comments, view the AI Suggested Comment in the right pane of the Overview tab. It might take a few seconds to appear. Either Accept it as-is or Edit and save it.
- To add a comment to a table column using AI-generated comments, click the AI generate button above the column list. Databricks generates comments for each column. Accept them as-is or edit them. Click the check mark to save the comment.
- To add a comment to an object that doesn’t support AI-generated comments, click Add comment to add a comment.
- To add a comment to a table column without using AI-generated comments, click the
Add comment icon in the column row.
- If a comment already exists, it appears in the right pane on the Overview tab or below the object name. If it is not AI-generated, click the
edit icon to edit it.
You can use basic Markdown to style comments in the Catalog Explorer UI. Markdown styling does not render when returned by DESCRIBE
statements. All basic syntax is supported in Catalog Explorer except images, and only two heading levels are rendered. For more information, see Basic Syntax.
For more information about AI-generated comments, see Add AI-generated comments to Unity Catalog objects.
You can use a SQL command to add a string literal as a comment to any securable object in Unity Catalog and to tables managed in the legacy Hive metastore. The SQL command you use depends on the object you want to add or edit the comment for:
-
To add or update a comment for any existing securable object except table columns, use the
COMMENT ON
command. See COMMENT ON.You can also use the
COMMENT
option with theALTER <object>
command for the object (for example,ALTER TABLE
). See the SQL reference article for theALTER <object>
command. -
To add or update a column comment for an existing table, use the
ALTER TABLE
command with theALTER COLUMN
clause and theCOMMENT
option on the column. See ALTER TABLE and ALTER TABLE … COLUMN clause. -
To add a comment when you create an object, use the
COMMENT
option with theCREATE <object>
command. See the SQL reference article for theCREATE <object>
command that you want to use.