-
-
Save tom-clickhouse/d67403a4e1663fcbc7f8d8c97ad8df08 to your computer and use it in GitHub Desktop.
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
INSERT INTO wikistat WITH | |
parseDateTimeBestEffort(extract(_file, '^pageviews-([\\d\\-]+)\\.gz$')) AS time, | |
splitByChar(' ', line) AS values, | |
splitByChar('.', values[1]) AS projects | |
SELECT | |
time, | |
projects[1] AS project, | |
projects[2] AS subproject, | |
decodeURLComponent(values[2]) AS path, | |
CAST(values[3], 'UInt64') AS hits | |
FROM s3Cluster('default', | |
'https://clickhouse-public-datasets.s3.amazonaws.com/wikistat/original/pageviews-202301*.gz', | |
'LineAsString') | |
WHERE length(values) >= 3 | |
SETTINGS | |
parallel_distributed_insert_select = 2, | |
max_insert_threads = 30; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment