.alter extent tags

The command runs in the context of a specific database. It alters the specified extent tags of all of the extents returned by the query.

The extents and the tags to alter are specified using a Kusto query that returns a recordset with a column called "ExtentId".

Requires Table admin permission for all involved tables.

Note

Data shards are called extents in Kusto, and all commands use "extent" or "extents" as a synonym. For more information on extents, see Extents (Data Shards) Overview.

Syntax

.alter [async] extent tags ('Tag1'[,'Tag2',...,'TagN']) <| query

async (optional): Execute the command asynchronously.

  • An Operation ID (Guid) is returned.
  • The operation's status can be monitored. Use the .show operations command.
  • You can retrieve the results of a successful execution. Use the .show operation details command.

Restrictions

All extents must be in the context database, and must belong to the same table.

Return output

Output parameter Type Description
OriginalExtentId string A unique identifier (GUID) for the original extent whose tags have been modified. The extent is dropped as part of the operation.
ResultExtentId string A unique identifier (GUID) for the result extent that has modified tags. The extent is created and added as part of the operation. Upon failure - "Failed".
ResultExtentTags string The collection of tags that the result extent is tagged with, or "null" in case the operation fails.
Details string Includes the failure details if the operation fails.

Examples

Alter tags

Alter tags of all the extents in table MyTable to MyTag

.alter extent tags ('MyTag') <| .show table MyTable extents

Alter tags of all extents

Alter tags of all the extents in table MyTable, tagged with drop-by:MyTag to drop-by:MyNewTag and MyOtherNewTag

.alter extent tags ('drop-by:MyNewTag','MyOtherNewTag') <| .show table MyTable extents where tags has 'drop-by:MyTag'

Sample output

OriginalExtentId ResultExtentId ResultExtentTags Details
e133f050-a1e2-4dad-8552-1f5cf47cab69 0d96ab2d-9dd2-4d2c-a45e-b24c65aa6687 drop-by:MyNewTag MyOtherNewTag
cdbeb35b-87ea-499f-b545-defbae091b57 a90a303c-8a14-4207-8f35-d8ea94ca45be drop-by:MyNewTag MyOtherNewTag
4fcb4598-9a31-4614-903c-0c67c286da8c 97aafea1-59ff-4312-b06b-08f42187872f drop-by:MyNewTag MyOtherNewTag
2dfdef64-62a3-4950-a130-96b5b1083b5a 0fb7f3da-5e28-4f09-a000-e62eb41592df drop-by:MyNewTag MyOtherNewTag