mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #25492 from morozovsk/patch-6
Documentation: manipulating projections
This commit is contained in:
commit
bf72ac0854
23
docs/en/sql-reference/statements/alter/projection.md
Normal file
23
docs/en/sql-reference/statements/alter/projection.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
toc_priority: 49
|
||||||
|
toc_title: PROJECTION
|
||||||
|
---
|
||||||
|
|
||||||
|
# Manipulating Projections {#manipulations-with-projections}
|
||||||
|
|
||||||
|
The following operations are available:
|
||||||
|
|
||||||
|
- `ALTER TABLE [db].name ADD PROJECTION name AS SELECT <COLUMN LIST EXPR> [GROUP BY] [ORDER BY]` - Adds projection description to tables metadata.
|
||||||
|
|
||||||
|
- `ALTER TABLE [db].name DROP PROJECTION name` - Removes projection description from tables metadata and deletes projection files from disk.
|
||||||
|
|
||||||
|
- `ALTER TABLE [db.]table MATERIALIZE PROJECTION name IN PARTITION partition_name` - The query rebuilds the projection `name` in the partition `partition_name`. Implemented as a [mutation](../../../sql-reference/statements/alter/index.md#mutations).
|
||||||
|
|
||||||
|
- `ALTER TABLE [db.]table CLEAR PROJECTION name IN PARTITION partition_name` - Deletes projection files from disk without removing description.
|
||||||
|
|
||||||
|
The commands ADD, DROP and CLEAR are lightweight in a sense that they only change metadata or remove files.
|
||||||
|
|
||||||
|
Also, they are replicated, syncing projections metadata via ZooKeeper.
|
||||||
|
|
||||||
|
!!! note "Note"
|
||||||
|
Projection manipulation is supported only for tables with [`*MergeTree`](../../../engines/table-engines/mergetree-family/mergetree.md) engine (including [replicated](../../../engines/table-engines/mergetree-family/replication.md) variants).
|
Loading…
Reference in New Issue
Block a user