Reputation: 107
I have several Tables and materialized views which haven't been created with To [db]
statement and have an inner tables with these names:
│ .inner_id.27e007b7-d831-4bea-8610-b3f0fd1ee018 │
│ .inner_id.3e27a1eb-f40f-4c6d-bc70-7722f2cc953b │
│ .inner_id.53c0fe00-151a-4bb5-ba61-237da8c1c6f2 │
│ .inner_id.7785fe45-94e0-42ee-8c0e-14f2d74e3c88 │
│ .inner_id.7d7e6485-e18e-47e0-9bb6-51a31a8cafd0 │
│ .inner_id.cd920d50-7469-4507-a5cf-244de054b037 │
│ .inner_id.fe6d3ce5-7ffc-4bca-9d6b-4015b1807e4f │
Which is different from the name of materialized views i used to create them.
Is there any way to get inner table name of materialized views with clickhouse query?
Upvotes: 4
Views: 2175
Reputation: 15226
To resolve uuid name use this query:
SELECT
uuid,
name
FROM system.tables
WHERE database = '{name_of_database}' AND engine = 'MaterializedView'
/*
┌─────────────────────────────────uuid─┬─name───────┐
│ 6b297d75-1c67-4824-9a60-94195c160436 │ mv_name_01 │
..
└──────────────────────────────────────┴────────────┘
*/
Upvotes: 8