local function row_to_tsv(row)
for i,elt in ipairs(row) do
- if type(elt) == 'table' then
+ local t = type(elt)
+ if t == 'table' then
row[i] = '[' .. array_to_string(elt) .. ']'
- elseif type(elt) == 'number' then
+ elseif t == 'number' then
row[i] = ch_number(elt)
+ elseif t == 'userdata' then
+ row[i] = clickhouse_quote(tostring(elt))
else
row[i] = clickhouse_quote(elt)
end
table.insert(custom_rows[k], lua_clickhouse.row_to_tsv(rule.get_row(task)))
end
- nrows = nrows + 1
local tsv_row = lua_clickhouse.row_to_tsv(row)
used_memory = used_memory + #tsv_row
data_rows[#data_rows + 1] = tsv_row
+ nrows = nrows + 1
lua_util.debugm(N, task,
"add clickhouse row %s / %s; used memory: %s / %s",
nrows, settings.limits.max_rows,