You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
Hello!
How can I drop all partitions of the table?
I played with system.parts:
ALTER TABLE my_table DROP PARTITION ID IN
(SELECT
ID
FROM system.parts
WHERE
active AND table = 'my_table')
or somthing like that.
but without success.
Thanks
Denis Zhuravlev
unread,
Aug 19, 2019, 1:57:55 PM8/19/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
generate SQL
select concat('alter table `',table, '` drop partition ',partition, ';') from system.parts where active = 1 and table like '%my_table%' group by database,table,partition order by database,table,partition
or truncate table my_table
kriticar
unread,
Aug 24, 2019, 1:51:47 PM8/24/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
How about dropping paritions of ReplicatedMergeTree table on cluster?
For example if I have 10 nodes, 5 masters and 5 replicas, I should execute result of select you have provided on 5 master nodes.
Is there a better way?
Regards
Denis Zhuravlev
unread,
Aug 24, 2019, 2:40:19 PM8/24/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ClickHouse
No better way.
But you can execute drop on cluster: alter table X on cluster segmented drop partition 201908
kriticar
unread,
Sep 3, 2019, 3:46:02 AM9/3/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message