v.19.13New Feature

CREATE TABLE AS Table_function() Is Now Possible #6057 (dimarub2000)

CREATE TABLE AS table_function() is now possible #6057 (dimarub2000)
CREATE TABLE can now be used with table functions, allowing tables to be created by directly selecting data from table functions.

Why it matters

This feature allows users to create tables based on the results of table functions, simplifying workflows where table functions generate dynamic or temporary datasets. It streamlines data ingestion and transformation by enabling direct table creation from these functions without intermediate steps.

How to use it

Use the syntax:

CREATE TABLE <table_name> AS <table_function()>;


Here, <table_function()> is any supported ClickHouse table function. This creates a new table populated with the data output of the table function.