Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Before you begin

TIMESTAMP data type

Timestamp is a date-time data type which represents the specified timeunit as integer values elapsed since the specified Unix Epoch.

DDL Syntax

TIMESTAMP [TIMEUNIT {value}]

Arguments

Argument Description Further information
TIMESTAMP Time and date data type used for time series analysis Time stamp
TIMEUNIT The time unit in which to store a timestamp that defaults to second s See TIMEUNIT values

Additional information

TIMEUNIT value

Unit Declaration
seconds (default) s
milliseconds ms
microseconds us
nanoseconds ns

Examples

CREATE TABLE with all data types

create table allcoltypes
  (
    _id id,
    intcol int min 0 max 10000,
    boolcol bool,
    timestampcol timestamp timeunit 'ms',
    decimalcol decimal(2),
    stringcol string,
    stringsetcol stringset,
    stringsetcolq stringsetq timequantum 'YMD' ttl '24h',
    idcol id,
    idsetcol idset,
    idsetcolq idsetq timequantum 'YMD' ttl '24h'
  )
  comment 'table containing all column types';