Clickhouse: Execution of ALTER queries on materialized views

Created on 11 Sep 2017  路  2Comments  路  Source: ClickHouse/ClickHouse

Currently execution of ALTER queries on materialized views has not been fully developed.
(according to documentation)

It will be very convenient if materialized view supports:

  • ALTER commands which are supported by underlaying table (with the same limitations).
  • ALTER to modify the query, which is used to transform data.
comp-matview feature

Most helpful comment

This feature would be very useful. I learned (via google groups search result) that the best way right now is:

  1. DETACH view
  2. ALTER the .inner. table of the view
  3. ATTACH the view with the updated table definition and select query

These steps are not atomic and if 2. or 3. fail, then you might have a problem. It's also not trivial to block all running clients from accessing the relevant tables while this is happening.

A full fletched ALTER on materialized views would solve these issues.

All 2 comments

This feature would be very useful. I learned (via google groups search result) that the best way right now is:

  1. DETACH view
  2. ALTER the .inner. table of the view
  3. ATTACH the view with the updated table definition and select query

These steps are not atomic and if 2. or 3. fail, then you might have a problem. It's also not trivial to block all running clients from accessing the relevant tables while this is happening.

A full fletched ALTER on materialized views would solve these issues.

@alexey-milovidov do you have a preference for alter materialized view query syntax? I might give it a try.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

opavader picture opavader  路  3Comments

jangorecki picture jangorecki  路  3Comments

zhicwu picture zhicwu  路  3Comments

igor-sh8 picture igor-sh8  路  3Comments

innerr picture innerr  路  3Comments