null

Creates a temporary table of the specified structure with the Null table engine. According to the Null-engine properties, the table data is ignored and the table itself is immediately droped right after the query execution. The function is used for the convenience of test writing and demonstrations.

Syntax

  1. null('structure')

Parameter

  • structure — A list of columns and column types. String.

Returned value

A temporary Null-engine table with the specified structure.

Example

Query with the null function:

  1. INSERT INTO function null('x UInt64') SELECT * FROM numbers_mt(1000000000);

can replace three queries:

  1. CREATE TABLE t (x UInt64) ENGINE = Null;
  2. INSERT INTO t SELECT * FROM numbers_mt(1000000000);
  3. DROP TABLE IF EXISTS t;

See also:

Original article