clickhouse中报错
关闭了自启动,删了status,重启了clickhouse还是报错
1,排查定时执行的脚本日志(每小时第5分钟执行)
INSERT INTO quality0529.previously_reported_urls (url) SELECT url FROM quality0529.hourly_data_view WHERE findUrlListLastTime >= now() - INTERVAL 1 HOUR GROUP BY url
2,查看ck执行异常详细信息统计
select max(query_start_time) as last_occur_time,count() as error_cnt,exception_code,any(exception) as exception,groupUniqArray(address) as addresses,groupUniqArray(initial_address) as initial_addresses,type,any(query) as query from system.query_log where type in (3,4) and toDate(query_start_time) = toDate(now()) group by toYYYYMMDD(query_start_time),type,exception_code order by error_cnt desc FORMAT Vertical;
在这里插入代码片
查看结果
报错中一个是超时,一个是查询数据量有点大14亿,但是表中每一小时都没有这么多
解决方法:一是增大超时
<max_execution_time>3600</max_execution_time>
二,在客户端执行sql:发现问题了,查询中没有带当天分区,所以14亿是全表扫描,有问题,于是添加上day和hour,问题解决