Atomic Partition Replacement

144 views
Skip to first unread message

Mike

unread,
Nov 9, 2021, 3:08:42 PM11/9/21
to ClickHouse
I am new to clickhouse and I am exploring it for a possible use case. I need to build a click house table where, say, the last month rows are changing constantly. let's call this  "last block". The change frequency of the last block could be as fast every 5 min or once a day. once a new last block is calculated (outside of clickhouse), I would like to be able to replace all the "last block" related rows with the newly calculated last block in one atomic operation. 

one way that I am thinking to do this is make the clickhouse partition to match my blocks, then insert my last black into a new table and then somehow replace the original table partition, with the new created partition of the new last block. I am only assuming this would be possible but have no idea how to actually do it with clickhouse yet. 

Could the above be done and make sense? if not, what do you recommend to atomically replace a portion of the latest data in a clickhouse table?




Mike

unread,
Nov 15, 2021, 7:00:41 PM11/15/21
to ClickHouse
Any help?

Ritesh

unread,
Nov 15, 2021, 11:14:00 PM11/15/21
to ClickHouse
Hi Mike,
Is your query really a ClickHouse "platform" specific query? Because as far as I can read, it seems to to relate to the implementation/code thereof which seems more to be concerning the application development (and not specifically Clickhouse platform specific)

I hope my response, if not accurate, is going to be helpful at least to the extent of getting more traction to it. 

All the best.

Reply all
Reply to author
Forward
0 new messages