v.21.1New Features
Implemented REPLACE TABLE and CREATE OR REPLACE TABLE Queries
ImplementedREPLACE TABLEandCREATE OR REPLACE TABLEqueries. #18521 (tavplubix).
Why it matters
This feature allows users to atomically replace an existing table with a new one or create the table if it does not exist, simplifying schema updates and table management without manual drop and create steps.How to use it
Users can use theREPLACE TABLE statement to replace an existing table with a new table definition and data. Alternatively, CREATE OR REPLACE TABLE can be used to create a table or replace it if it already exists. For example:CREATE OR REPLACE TABLE table_name (...);
REPLACE TABLE table_name AS SELECT * FROM another_table;