Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Switch services using the Version drop-down list. Learn more about navigation.
Applies to: ✅ Azure Data Explorer
Drops a materialized view.
Permissions
You must have at least Materialized View Admin permissions to run this command.
Syntax
.drop materialized-view MaterializedViewName [ifexists]
Learn more about syntax conventions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| MaterializedViewName | string |
✔️ | Name of the materialized view. |
Returns
The command returns all materialized views in the database, after the drop, which is the output of the show materialized view command.
Output schema:
| Name | Type | Description |
|---|---|---|
| Name | string |
Name of the materialized view. |
| SourceTable | string |
Name of source table on which the view is defined. |
| Query | string |
Query definition of the materialized view. |
| MaterializedTo | datetime |
Maximum materialized ingestion_time() timestamp in source table. For more information, see how materialized views work. |
| LastRun | datetime |
Last time materialization was run. |
| LastRunResult | string |
Result of last run. Returns Completed for successful runs, otherwise Failed. |
| IsHealthy | bool |
false only when the view is stuck:• At least five consecutive materialization attempts failed, and MaterializedTo is more than one hour old and hasn't caught up to the database cursor.• The view status is FAILED.• A view that's catching up, handling an ingestion burst, or waiting for a concurrency slot is true, even if its age exceeds one hour.• A disabled view can also appear as true. Check IsEnabled as well. |
| IsEnabled | bool |
true when view is enabled (see Disable or enable materialized view). |
| Folder | string |
Folder under which the materialized view is created. |
| DocString | string |
Description assigned to the materialized view. |
| AutoUpdateSchema | bool |
Whether the view is enabled for auto updates. |
| EffectiveDateTime | datetime |
Effective date time of the view, determined during creation time (see .create materialized-view). |
| Lookback | timespan |
The time span that limits the period during which duplicates or updates are expected. For more information, see Lookback period. |
| LookbackColumn | string |
A string column in the view which serves as the reference for the lookback period. If this column is empty, but the lookback has a value, then the materialized view uses a default lookback. For more information, see Lookback period. |
Examples
Drop one materialized view
The following command drops materialized view ViewName:
.drop materialized-view ViewName
Output
| Name | SourceTable | Query | MaterializedTo | LastRun | LastRunResult | IsHealthy | IsEnabled | Folder | DocString | AutoUpdateSchema | EffectiveDateTime | Lookback |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ArgMax | T | T | summarize arg_max(Timestamp, *) by User | 2023-02-26T16:40:03.3345704Z | 2023-02-26T16:44:15.9033667Z | Completed | true | true | false | 2023-02-23T14:01:42.5172342Z | |||
| MyView | MyTable | MyTable | summarize arg_max(Column3, *) by Column1 | 2023-02-26T16:40:03.3345704Z | 2023-02-26T16:44:15.9033667Z | Completed | true | true | true | 2023-02-23T14:01:42.5172342Z |