Cancela a exclusão da tabela.
A partir da versão 23.3 do ClickHouse, é possível executar UNDROP em uma tabela de um banco de dados Atomic
até database_atomic_delay_before_drop_table_sec (8 minutos por padrão) após emitir a instrução DROP TABLE. As tabelas excluídas são listadas na
tabela de sistema system.dropped_tables.
Se você tiver uma visão materializada sem uma cláusula TO associada à tabela excluída, também precisará executar UNDROP na tabela interna dessa visão.
Sintaxe:
UNDROP TABLE [db.]name [UUID '<uuid>'] [ON CLUSTER cluster]
Exemplo
CREATE TABLE tab
(
`id` UInt8
)
ENGINE = MergeTree
ORDER BY id;
DROP TABLE tab;
SELECT *
FROM system.dropped_tables
FORMAT Vertical;
Row 1:
──────
index: 0
database: default
table: tab
uuid: aa696a1a-1d70-4e60-a841-4c80827706cc
engine: MergeTree
metadata_dropped_path: /var/lib/clickhouse/metadata_dropped/default.tab.aa696a1a-1d70-4e60-a841-4c80827706cc.sql
table_dropped_time: 2023-04-05 14:12:12
1 row in set. Elapsed: 0.001 sec.
UNDROP TABLE tab;
SELECT *
FROM system.dropped_tables
FORMAT Vertical;
```response
Ok.
0 rows in set. Elapsed: 0.001 sec.
DESCRIBE TABLE tab
FORMAT Vertical;
Row 1:
──────
name: id
type: UInt8
default_type:
default_expression:
comment:
codec_expression:
ttl_expression:
Última modificação em 10 de junho de 2026