v.22.7New Feature
Added CREATE TABLE ... EMPTY AS SELECT Query to Deduce Table Structure
Added CREATE TABLE ... EMPTY AS SELECT query. It automatically deduces table structure from the SELECT query, but does not fill the table after creation. Resolves #38049. #38272 (Alexander Tokmakov).Why it matters
This feature allows users to efficiently create tables with schemas inferred from existing queries, eliminating the need to manually define the table structure. It is useful when you want to prepare an empty table matching the result set of aSELECT query for later data insertion.How to use it
Use theCREATE TABLE ... EMPTY AS SELECT syntax, where the table schema will be deduced from the SELECT query provided, but the table will be created empty without any data inserted.