Update Table
update-tablePurpose: Change the sorting key of an existing RawTree table.
Instructions
Purpose: Change the sorting key of an existing RawTree table.
NOT for: Renaming a table, adding columns, or changing storage. Only the sorting key can be updated.
Returns: The database and table names plus the new sorting key.
Behavior: Provide a comma-separated SQL expression string in key order, lowest cardinality first. A bare name such as user.id is read as a path into the ingested JSON. The new key applies to newly inserted parts and wins later merges, so existing parts are re-sorted in the background instead of being rewritten by this call. Call describe-table first to see the current key.
Limits: The key must contain at least one expression; a table's sorting key cannot be removed once set. RawTree validates the SQL expressions and the engine may reject an unusable key.
Auth: Requires organization admin access. Authorization is enforced by the RawTree API.
Safety: You MUST confirm the exact table name and sorting expression order with the user before calling this tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name to update. | |
| cluster | No | RawTree cluster to use for this operation. | |
| database | No | Optional RawTree database override. RawTree uses the default database when omitted. | |
| sortingKey | Yes | Comma-separated SQL sorting expressions in key order, for example "region, ifNull(cityHash64(host, instanceId), 0)". A bare name such as "user.id" is read as a path into the ingested JSON. | |
| organization | No | RawTree organization containing the target cluster. |