-
-
Save tom-clickhouse/2362a0279f2159cc162e0105bc745952 to your computer and use it in GitHub Desktop.
Table with partitioning key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE default.upclick_metrics | |
( | |
`target` String, | |
`status_code` UInt8, | |
`latency` UInt16, | |
`continent_code` String, | |
`country_iso_code` String, | |
`country_name_en` String, | |
`city_name_en` String, | |
`latitude` Float64, | |
`longitude` Float64, | |
`receive_timestamp` DateTime64 MATERIALIZED now64() | |
) | |
ENGINE = ReplicatedMergeTree | |
PARTITION BY continent_code | |
ORDER BY (target, status_code, continent_code, country_iso_code, country_name_en, city_name_en) | |
SETTINGS old_parts_lifetime = 86400; -- for getting the part names from system.parts table for a bit longer than 8 minutes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment