.alter materialized-view policy partitioning command

Applies to: ✅ Azure Data Explorer

Changes the materialized view's partitioning policy. The partitioning policy defines if and how extents (data shards) should be partitioned for a specific table or a materialized view.

Permissions

You must have at least Table Admin permissions to run this command.

Syntax

.alter materialized-view MaterializedViewName policy partitioning PolicyObject

Learn more about syntax conventions.

Parameters

Name Type Required Description
MaterializedViewName string ✔️ The name of the materialized view.
PolicyObject string ✔️ A policy object used to set the partitioning policy. For more information, see partitioning policy.

Example

Set a policy on the materialized view with two kinds of partition keys:

.alter materialized-view [materialized_view_table_name] policy partitioning ```
{
  "PartitionKeys": [
    {
      "ColumnName": "my_string_column",
      "Kind": "Hash",
      "Properties": {
        "Function": "XxHash64",
        "MaxPartitionCount": 128,
        "PartitionAssignmentMode": "Uniform"
      }
    },
    {
      "ColumnName": "my_datetime_column",
      "Kind": "UniformRange",
      "Properties": {
        "Reference": "1970-01-01T00:00:00",
        "RangeSize": "1.00:00:00",
        "OverrideCreationTime": false
      }
    }
  ]
}```