栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Go语言

clickhouse删除数据常见报错

Go语言 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

clickhouse删除数据常见报错

clickhouse 删除数据常见异常
  • Expected one of: DATABASE, TEMPORARY, TABLE

truncate login_log_struct;

Syntax error: failed at position 10:

truncate login_log_struct;

Expected one of: DATABASE, TEMPORARY, TABLE

解决方案

drop table login_log_struct;

  • Code: 359. DB::Exception: Received from localhost:9000. DB::Exception: Table or Partition in 库.表 was not dropped.

drop table login_log_struct;

# 分区删除,不超过50GB, 表删除,不超过200GB
Received exception from server (version 19.15.3):
Code: 359. DB::Exception: Received from localhost:9000. DB::Exception: Table or Partition in flash.flash_login_log_struct was not dropped.
Reason:
1. Size (1.09 TB) is greater than max_[table/partition]_size_to_drop (200.00 GB)
2. File '/data/clickhouse/flags/force_drop_table' intended to force DROP doesn't exist
How to fix this:
3. Either increase (or set to zero) max_[table/partition]_size_to_drop in server config and restart ClickHouse
4. Either create forcing file /data/clickhouse/flags/force_drop_table and make sure that ClickHouse has write permission for it.
Example:
sudo touch '/data/clickhouse/flags/force_drop_table' && sudo chmod 666 '/data/clickhouse/flags/force_drop_table'.

解决方案

  1. 修改200G的限制,这个功能主要是怕操作不当,一次性直接删除了全表数据,建议不要修改;
  2. 删除占用磁盘较大的字段,当数据量小于该限制,就可以使用删除表了

操作一:
alter table login_log_struct drop partition (‘202012’,‘20201231’);
操作二:
alter table login_log_struct drop column field1;

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/906848.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号