Clickhouse批量导入数据时提示分区数太大,超过了100个分区
Too many partitions for single INSERT block (more than 100)
The limit is controlled by 'max_partitions_per_insert_block' setting.
Large number of partitions is a common misconception.
原因:
clickhouse 要求每次写入的数据不能跨越特别多的 partitions,具体受参数 max_partitions_per_insert_block 控制,调整该参数即可。
解决方法:
修改配置文件/etc/clickhouse-server/users.xml
,加入如下配置
<max_partitions_per_insert_block>5000</max_partitions_per_insert_block>
然后重启 clickhouse
clickhouse restart
注:分区数不要设置得过大,否则可能反而降低效率。