S
через sequenceMatch не получается?
почему?
https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/parametric-functions/#function-sequencematch
Size: a a a
S
YG
AS
IK
pk
IK
DM
A
A
CREATE TABLE test_test.test
(
`uuid` UUID,
`status` Enum8('approved' = 1, 'in_progress' = 2, 'canceled' = 3),
`cost` UInt64,
`currency` Enum8('USD' = 1, 'RUB' = 2),
`EventDate` Date,
`EventDateTime` DateTime
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(EventDate)
ORDER BY (uuid, EventDate)
SETTINGS index_granularity = 8192
ALTER TABLE test
MODIFY TTL EventDate + toIntervalMonth(6) TO DISK 'hdd'
SETTINGS storage_policy = 'ssd_only'
Exception on client:
Code: 115. DB::Exception: Unknown setting storage_policy: in attempt to set the value of setting 'storage_policy' to 'ssd_only'
CREATE TABLE test1
(
`uuid` UUID,
`status` Enum8('approved' = 1, 'in_progress' = 2, 'canceled' = 3),
`cost` UInt64,
`currency` Enum8('USD' = 1, 'RUB' = 2),
`EventDate` Date,
`EventDateTime` DateTime
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(EventDate)
ORDER BY (uuid, EventDate)
TTL EventDate + toIntervalWeek(2) TO DISK 'hdd'
SETTINGS storage_policy = 'ssd_only'
Ok.
0 rows in set. Elapsed: 0.002 sec.
S
CREATE TABLE test_test.test
(
`uuid` UUID,
`status` Enum8('approved' = 1, 'in_progress' = 2, 'canceled' = 3),
`cost` UInt64,
`currency` Enum8('USD' = 1, 'RUB' = 2),
`EventDate` Date,
`EventDateTime` DateTime
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(EventDate)
ORDER BY (uuid, EventDate)
SETTINGS index_granularity = 8192
ALTER TABLE test
MODIFY TTL EventDate + toIntervalMonth(6) TO DISK 'hdd'
SETTINGS storage_policy = 'ssd_only'
Exception on client:
Code: 115. DB::Exception: Unknown setting storage_policy: in attempt to set the value of setting 'storage_policy' to 'ssd_only'
CREATE TABLE test1
(
`uuid` UUID,
`status` Enum8('approved' = 1, 'in_progress' = 2, 'canceled' = 3),
`cost` UInt64,
`currency` Enum8('USD' = 1, 'RUB' = 2),
`EventDate` Date,
`EventDateTime` DateTime
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(EventDate)
ORDER BY (uuid, EventDate)
TTL EventDate + toIntervalWeek(2) TO DISK 'hdd'
SETTINGS storage_policy = 'ssd_only'
Ok.
0 rows in set. Elapsed: 0.002 sec.
When creating a table, one can apply one of the configured storage policies to it:https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/mergetree/
CREATE TABLE table_with_non_default_policy (
EventDate Date,
OrderID UInt64,
BannerID UInt64,
SearchPhrase String
) ENGINE = MergeTree
ORDER BY (OrderID, BannerID)
PARTITION BY toYYYYMM(EventDate)
SETTINGS storage_policy = 'moving_from_ssd_to_hdd'
The default storage policy implies using only one volume, which consists of only one disk given in <path>. Once a table is created, its storage policy cannot be changed.
S
S
A
S
A
D
pk
D
D