summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-07 11:17:09 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-07 11:17:09 +0100
commite7c1a6a9a153a5832fd7748927961949b63728cb (patch)
tree773e4f8ee627f17f076975cc955aa3f2da8551c8
parentd916f02050c63045ec7eb6e238dd281337e804c5 (diff)
downloadrspamd-e7c1a6a9a153a5832fd7748927961949b63728cb.tar.gz
rspamd-e7c1a6a9a153a5832fd7748927961949b63728cb.zip
[Minor] Clickhouse: Fix extra columns that are arrays
-rw-r--r--src/plugins/lua/clickhouse.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua
index cf70abab4..5cce0a442 100644
--- a/src/plugins/lua/clickhouse.lua
+++ b/src/plugins/lua/clickhouse.lua
@@ -1331,8 +1331,14 @@ if opts then
rspamd_logger.errx(rspamd_config, 'cannot add clickhouse extra row %s: no type or no selector',
col_name)
else
+ local is_array = false
+
+ if col_data.type:lower():match('^array') then
+ is_array = true
+ end
+
local selector = lua_selectors.create_selector_closure(rspamd_config,
- col_data.selector, col_data.delimiter or '', false)
+ col_data.selector, col_data.delimiter or '', is_array)
if not selector then
rspamd_logger.errx(rspamd_config, 'cannot add clickhouse extra row %s: bad selector: %s',
@@ -1341,7 +1347,7 @@ 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 is_array then
col_data.default_value = {}
else
col_data.default_value = ''