commit 670f8af: [Feature] Clickhouse: Modernise table initial schema

Vsevolod Stakhov vsevolod at highsecure.ru
Fri May 3 10:49:05 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-05-03 11:43:37 +0100
URL: https://github.com/rspamd/rspamd/commit/670f8af4859716e7f5dda4ea97515b583a8b7b28 (HEAD -> master)

[Feature] Clickhouse: Modernise table initial schema

---
 src/plugins/lua/clickhouse.lua | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index 6e427682f..af23e428e 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -92,7 +92,7 @@ CREATE TABLE rspamd
     From String,
     MimeFrom String,
     IP String,
-    Score Float64,
+    Score Float32,
     NRcpt UInt8,
     Size UInt32,
     IsWhitelist Enum8('blacklist' = 0, 'whitelist' = 1, 'unknown' = 2) DEFAULT 'unknown',
@@ -133,7 +133,9 @@ CREATE TABLE rspamd
     SMTPRcpt ALIAS if(RcptDomain = '', '', concat(RcptUser, '@', RcptDomain)),
     MIMEFrom ALIAS if(MimeFrom = '', '', concat(MimeUser, '@', MimeFrom)),
     MIMERcpt ALIAS MimeRecipients[1]
-) ENGINE = MergeTree(Date, (TS, From), 8192)
+) ENGINE = MergeTree()
+PARTITION BY Date
+ORDER BY TS
 ]],
 [[CREATE TABLE rspamd_version ( Version UInt32) ENGINE = TinyLog]],
 [[INSERT INTO rspamd_version (Version) Values (${SCHEMA_VERSION})]],


More information about the Commits mailing list