.create table

.create table

Declare a table and column types before ingesting records. Additional columns are still inferred during ingestion; declarations do not lock the schema.

Run management commands through the query editor or the normal query API in the destination account. Creation requires a query scope allowing control commands, account-management capability, and current account-administrator or global-administrator membership.

Spec

.create table '<table_name>' (<column_name>:<type>, ...)

Parameters

  • table_name: Table name within the current account. A simple name may also be unquoted.
  • column_name: Unquoted column identifier. At least one column is required; names must be unique. Names beginning with __INFLOW_ are reserved.
  • type: String, Int64, UInt64, Float64, DateTime, Timespan, Boolean, Int128 (UUID), Json, or BlobReference. Query type aliases such as string are accepted.

The timestamp:DateTime column is added automatically. Declared columns are nullable and may be omitted from records. An incompatible existing type is rejected; this command does not convert stored data. Repeating an existing matching declaration is safe. Use .create-merge table to add declarations to an existing table.

Example

.create table 'logs' (message:string, count:Int64, screenshot:BlobReference)

Declare a blob-reference column before attaching uploaded blobs. See table declarations and ingestion.