【发布时间】:2020-09-24 18:30:17
【问题描述】:
在字符串字段中使用带有单引号的 CSV 文件插入会导致此类情况出现错误
"'Catbug' Animated Series In The Works From 'Adventure Time ..."
但其他使用单引号的场景加载成功。这个问题有解决办法吗?
【问题讨论】:
标签: clickhouse
在字符串字段中使用带有单引号的 CSV 文件插入会导致此类情况出现错误
"'Catbug' Animated Series In The Works From 'Adventure Time ..."
但其他使用单引号的场景加载成功。这个问题有解决办法吗?
【问题讨论】:
标签: clickhouse
通过使用format_csv_allow_single_quotes-参数禁止将单引号解释为分隔符:
echo "'Catbug' Animated Series In The Works From 'Adventure Time ..." |
clickhouse-client --query "insert into test format CSV" --format_csv_allow_single_quotes 0
echo "'Catbug' Animated Series In The Works From 'Adventure Time ..." |
clickhouse-client --query "insert into test format CSV settings format_csv_allow_single_quotes=0"
【讨论】:
clickhouse-client --format_csv_allow_single_quotes=0
这是因为 CH 使用第一个字符 ' 或 " 自动发现使用过的引号
【讨论】: