Skip to content

Commit

Permalink
fix: distributed tables
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Nov 16, 2023
1 parent 210161e commit f4c8073
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/db/maintain/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,21 +345,23 @@ module.exports.profiles_dist = [

`CREATE TABLE IF NOT EXISTS profiles_series {{{OnCluster}}} (
date Date,
type_id LowCardinality(String),
fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)),
tags Array(Tuple(String, String)) CODEC(ZSTD(1)),
) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`,

`CREATE TABLE IF NOT EXISTS profiles_series_gin {{{OnCluster}}} (
`CREATE TABLE IF NOT EXISTS profiles_series_gin_dist {{{OnCluster}}} (
date Date,
key String,
val String,
type_id LowCardinality(String),
fingerprint UInt64 CODEC(DoubleDelta, ZSTD(1)),
) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles',fingerprint);`,
) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_gin',fingerprint);`,

`CREATE TABLE IF NOT EXISTS profiles_series_keys {{{OnCluster}}} (
`CREATE TABLE IF NOT EXISTS profiles_series_keys_dist {{{OnCluster}}} (
date Date,
key String,
val String,
val_id UInt64,
) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles', rand());`
) ENGINE = Distributed('{{CLUSTER}}','{{DB}}','profiles_series_keys', rand());`
]

0 comments on commit f4c8073

Please sign in to comment.