在ClickHouse数据库中通过CSV格式插入字符串数组

时间:2016-09-06 15:03:34

标签: clickhouse

我有一张简单的表格:

CREATE TABLE t1
(
    v1 Int32, 
    a1 Array(Int32), 
    s2 Array(String)
) ENGINE = Memory

但无法弄清楚如何插入String数组:

insert into t1 format CSV 1,"[1,2]","[a1,a2]"

因以下错误而失败:

Exception on client:
Code: 26. DB::Exception: Cannot parse quoted string: expected opening     quote: 
Could not print diagnostic info because two last rows aren't in    buffer (rare case)
: (at row 1)

1 个答案:

答案 0 :(得分:2)

抱歉,重新阅读文档,发现数组中的字符串应该用单引号括起来。

 insert into t1 format CSV 1,"[1,2]","['a1','a2']"
相关问题