mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 11:33:46 +00:00
764 B
764 B
sidebar_position | sidebar_label |
---|---|
41 | SAMPLE BY |
Manipulating Sampling-Key Expressions
Syntax:
ALTER TABLE [db].name [ON CLUSTER cluster] MODIFY SAMPLE BY new_expression
The command changes the sampling key of the table to new_expression
(an expression or a tuple of expressions).
The command is lightweight in the sense that it only changes metadata. The primary key must contain the new sample key.
:::note
It only works for tables in the MergeTree family (including replicated tables).
:::