ClickHouse异常问题记录
1.插⼊报错
ClickHouse exception, code: 6, host: 28, port: 8123; Code: 6, e.displayText()= DB::Exception: Cannot parse string '12345 ' as Int64: syntax error at begin of string. Note: there are toInt64OrZero and toInt64OrNull functions, which returns zero/NULL instead of throwing exception.: while executing 'FUN CTION CAST(assumeNotNull(_dummy_0) :: 2, 'Int64' :: 1) -> CAST(assumeNotNull(_dummy_0), 'Int64') Int64 : 4'(version 21.3.2.5 (official build))
error parse new可能原因:
传⼊的数字字符串有空格,clickhouse⾃动解析时空格报错
2.⽆法执⾏ddl(alter 操作)
Cannot execute replicated DDL query on leader;
这⾥原因⽐较多,后⾯有详细的报⽂,按照提⽰来,如果是表太⼤,先按照分区DROP⼀部分再DROP TABLE,如果是其他的,需要在分析。
3.Cannot parse string ‘2021-11-26 09:25:00:000’ as DateTime64(3)
Cannot parse string '2021-11-26 09:25:00:000' as DateTime64(3): syntax error at position 19(parsed just '2021-11-26 09:25:00'): while executing 'FUNCT ION CAST(assumeNotNull(_dummy_0) :: 2, 'DateTime64(3)' :: 1) -> CAST(assumeNotNull(_dummy_0), 'DateTime64(3)') DateTime64(3) : 4'(version 21.3.
2.5 (official build))
date_time DateTime64(3) COMMENT ‘⽇期时间,精度到秒’ CODEC(DoubleDelta,LZ4)
这种是⽀持毫秒的,但是格式是 yyyy-MM-dd HH:mm:ss.SSS
我这边犯了个错误 yyyy-MM-dd HH:mm:ss:SSS 写成这样的导致出错。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。