v.21.9Improvement
Flush Distributed Table on REPLACE TABLE Query and Handle Insertion Failures
FlushDistributedtable onREPLACE TABLEquery. Resolves #24566 - Do not replace (or create) table on[CREATE OR] REPLACE TABLE ... AS SELECTquery if insertion into new table fails. Resolves #23175. #25895 (tavplubix).
Why it matters
This feature addresses issues where a table could be replaced or created during a[CREATE OR] REPLACE TABLE ... AS SELECT query even if the data insertion into the new table fails. It prevents incomplete or inconsistent table states by flushing data on Distributed tables before replacement, thereby improving reliability and data integrity.How to use it
Use theREPLACE TABLE or CREATE OR REPLACE TABLE syntax as usual with AS SELECT statements. The flushing of Distributed tables is handled automatically during these queries to ensure that the replacement occurs only if the insertion into the new table succeeds.