ClickHouse导入CSV文件跳过错误【译文】

2017-12-03  本文已影响1074人  JackpGao

原文

翻译有误请指正~

ClickHouse是来自“战斗民族”的高性能分析性数据库,圈内人戏称为“喀秋莎数据库”。

背景

Code: 27. DB::Exception: Cannot parse input: expected , 
before: an,,113.143.235.107,,,
https://ads.diamonds/c/3b4336c6-db9a-11e5-bea8-021988c520a1?cid=%COOKIEID&campaignid=%HASH_CODE&pubid=%ADD_CODE&subid=%PLACEMENT,2017-09-0: (at row 865704)

回复

/** Maximum amount of errors while reading text formats (like CSV, TSV). \
  * In case of error, if both values are non-zero, \
  *  and at least absolute or relative amount of errors is lower than corresponding value, \
  *  will skip until next line and continue. \
  */ \
M(SettingUInt64, input_format_allow_errors_num, 0) \
M(SettingFloat, input_format_allow_errors_ratio, 0)

使用方式

<input_format_allow_errors_num>100</input_format_allow_errors_num>

译者注

先吐槽

clickhouse-client --input_format_allow_errors_num=1 \
--input_format_allow_errors_ratio=0.1 \
--query="INSERT INTO test.formats_test FORMAT TSV"
上一篇下一篇

猜你喜欢

热点阅读