diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-17 14:18:50 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-17 14:18:50 +0000 |
commit | e18234e27fab11400354c6d57d9841b593acbfcb (patch) | |
tree | 8c2e478306638c02dac9c4de86292ccd9e731766 /src/plugins | |
parent | 1e3f1f0c2d454ee283c05c70912993cf199e0fe1 (diff) | |
download | rspamd-e18234e27fab11400354c6d57d9841b593acbfcb.tar.gz rspamd-e18234e27fab11400354c6d57d9841b593acbfcb.zip |
[Feature] Clickhouse: Add extra columns support
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/clickhouse.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index ab1693b48..a5067d014 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -843,7 +843,7 @@ local function clickhouse_collect(task) -- Extra columns if #settings.extra_columns > 0 then for _,col in ipairs(settings.extra_columns) do - local elts = col.selector(task) + local elts = col.real_selector(task) if elts then table.insert(row, elts) @@ -1337,12 +1337,13 @@ if opts then settings.extra_columns[col_name] = nil else if not col_data.default_value then - if col_data.type:lower():match('Array') then + if col_data.type:lower():match('^array') then col_data.default_value = {} else col_data.default_value = '' end end + col_data.real_selector = selector end end end |