Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot drop large materialized view in Clickhouse

I have a materialized view thats larger than 50gb.

When I want to go drop the materialized view, it keeps coming back with

Size (58.45 GB) is greater than max_[table/partition]_size_to_drop (50.00 GB) 2. File '/var/lib/clickhouse/flags/force_drop_table' intended to force DROP doesn't exist How to fix this:

  1. Either increase (or set to zero) max_[table/partition]_size_to_drop in server config
  2. Either pass a bigger (or set to zero) max_[table/partition]_size_to_drop through query settings
  3. Either create forcing file /var/lib/clickhouse/flags/force_drop_table and make sure that ClickHouse has write permission for it. Example: sudo touch '/var/lib/clickhouse/flags/force_drop_table' && sudo chmod 666 '/var/lib/clickhouse/flags/force_drop_table'. (TABLE_SIZE_EXCEEDS_MAX_DROP_SIZE_LIMIT) (version 24.1.5.6 (official build)). (TABLE_SIZE_EXCEEDS_MAX_DROP_SIZE_LIMIT)

I tried setting the max_table_size_to_drop to 0, but with no success

like image 388
thinkSystemDev Avatar asked Dec 07 '25 07:12

thinkSystemDev


2 Answers

Can you try this command:

drop view ... SETTINGS max_table_size_to_drop = 0;
like image 96
Tom Schreiber Avatar answered Dec 10 '25 01:12

Tom Schreiber


According to https://clickhouse.com/docs/en/operations/server-configuration-parameters/settings#max_table_size_to_drop

max_table_size_to_drop this is a global server settings, try to change it in /etc/clickhouse-server/config.d/max_table_size_to_drop.xml

<clickhouse><max_table_size_to_drop>0</max_table_size_to_drop></clickhouse>

after that restart clickhouse-server

like image 20
Slach Avatar answered Dec 09 '25 23:12

Slach