Update dataset table structure
This document covers the prerequisites, usage, and expected results of this capability. The appendix lists the required input information.
How it works
This capability lets you use natural language instructions to modify the metadata table of an existing unstructured dataset, such as by adding or modifying columns and updating comments. Since the metadata table structure cannot be edited directly, the agent uses a three-step process: First, it runs database modification statements through an ad hoc query to alter the physical table. Second, it resubmits the complete table structure, now consistent with the database, to the dataset. Finally, it performs a read-back check to ensure the dataset table structure matches the physical table column by column.
Use cases:
-
Add metadata table columns for multi-column output from a workflow or for URL bridging.
-
Add a vector column for vector search.
-
Modify information, such as comments, for columns in the metadata table.
Limitations: The metadata table structure cannot be edited online. Changes must be applied through a three-step process of modifying the database table, resubmitting the table structure, and performing a check. This process is not supported for metadata stored in Milvus. To avoid breaking changes, we recommend adding only new columns rather than deleting or modifying existing columns that are referenced by a workflow.
Prerequisites
-
The target dataset exists, and its metadata is stored in a storage type that supports structure changes, such as PostgreSQL or Lindorm.
-
You have the details of the columns to be changed, including the column name, data type, and comment.
-
Before making any changes, verify which workflows reference the dataset version. We recommend not deleting or modifying columns that are already in use.
Examples
Here are some example prompts you can use:
-
Add a column named 'summary' of type 'text' with the comment 'Summary' to the metadata table of the knowledge base dataset.
-
Add table columns to match the multi-column output from feature extraction, then reload the dataset table structure.
-
Add a URL bridging column to the dataset's metadata table.
Interaction steps:
-
After you specify the table and columns to change, the agent reads the dataset's current state and generates a change plan. This plan outlines the differences between the current and target columns and includes the necessary change statements.
-
The agent prompts you to confirm the changes and to check if the dataset version is referenced by any workflows.
-
After confirmation, the agent uses an ad hoc query to modify the physical table and then resubmits the complete, updated table structure to the dataset.
-
After submission, the agent performs a read-back check to verify that the dataset's table structure and the physical table are identical, column by column.
Results
After the operation is complete, you can expect the following results:
-
Output: The execution and submission results of the table structure change.
-
Completion status: After a successful change, the dataset's metadata table structure will be consistent with the physical table.
-
Verification: You can go to the Dataset Details page in Dataphin to view the table structure of the target version and confirm that the new column has been added.
A command-line success message only indicates that the request was accepted. Always check the Dataphin UI for the final status.
Appendix: Input information
The following table lists information that may be required when updating a dataset table structure. This is for reference only. In practice, the agent automatically identifies this information from your prompts and will ask you if anything is missing. Items marked as "not required" are system-generated and do not need to be provided.
|
Item |
Required |
Description |
Example |
|
tenant ID |
Conditionally Required |
If multiple tenants share the same service endpoint, you must explicitly specify the tenant to which the project belongs. |
1234567890123456789 |
|
project ID |
Yes |
The Dataphin project to which the dataset belongs. |
— |
|
Target dataset |
Yes |
The name or identifier of the dataset to modify. |
— |
|
Target version and table |
Yes |
The dataset version and the metadata table to modify. |
— |
|
Changes |
Yes |
Details of the columns to add or modify, such as name, data type, and comment. |
Add a summary column of type text |
|
Execution project |
No |
The project where the ad hoc query runs. By default, this is the same project that the dataset belongs to. |
— |