|
| 1 | +-- Origin SQL: |
| 2 | +CREATE TABLE IF NOT EXISTS test_local |
| 3 | +( |
| 4 | + `id` UInt64 CODEC(Delta, ZSTD(1)), |
| 5 | + `api_id` UInt64 CODEC(ZSTD(1)), |
| 6 | + `arr` Array(Int64), |
| 7 | + `content` String CODEC(ZSTD(1)), |
| 8 | + `output` String, |
| 9 | + INDEX id_idx id TYPE minmax GRANULARITY 10, |
| 10 | + INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, |
| 11 | + INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, |
| 12 | + INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1, |
| 13 | + INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2 |
| 14 | +) |
| 15 | +ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') |
| 16 | +PARTITION BY toStartOfHour(`timestamp`) |
| 17 | +ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`) |
| 18 | +TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY,toStartOfHour(`timestamp`) + INTERVAL 2 DAY |
| 19 | +SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1; |
| 20 | + |
| 21 | + |
| 22 | +-- Format SQL: |
| 23 | +CREATE TABLE IF NOT EXISTS test_local |
| 24 | +( |
| 25 | + `id` UInt64 CODEC(Delta, ZSTD(1)), |
| 26 | + `api_id` UInt64 CODEC(ZSTD(1)), |
| 27 | + `arr` Array(Int64), |
| 28 | + `content` String CODEC(ZSTD(1)), |
| 29 | + `output` String, |
| 30 | + INDEX id_idx id TYPE minmax GRANULARITY 10, |
| 31 | + INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, |
| 32 | + INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, |
| 33 | + INDEX content_idx content TYPE tokenbf_v1(30720,2,0) GRANULARITY 1, |
| 34 | + INDEX output_idx output TYPE ngrambf_v1(3,10000,2,1) GRANULARITY 2 |
| 35 | +) |
| 36 | +ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') |
| 37 | +PARTITION BY toStartOfHour(`timestamp`) |
| 38 | +TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY,toStartOfHour(`timestamp`) + INTERVAL 2 DAY |
| 39 | +SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1 |
| 40 | +ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`); |
0 commit comments