在clickhouse数据库中通过csv格式插入字符串数组

to94eoyn  于 2021-07-15  发布在  ClickHouse
关注(0)|答案(1)|浏览(633)

我有一张简单的table:

  1. CREATE TABLE t1
  2. (
  3. v1 Int32,
  4. a1 Array(Int32),
  5. s2 Array(String)
  6. ) ENGINE = Memory

但不知道如何插入字符串数组:

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

失败并出现以下错误:

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

ttp71kqs1#

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

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

相关问题