DDSQL Data Types

Join the Preview!

DDSQL is in Preview.

Request Access

Data types

DDSQL implements a simplified version of the SQL type system that is mostly descended from PostgreSQL.

Base types

SQL nameAliasesDescription
integerintStorage is always int64.
textchar, varchar, stringStorage is always an unlimited length UTF-8.
realdouble, decimalStorage is always IEEE-754 float64.
timestamptimestamp without time zoneSQL standard datetime type.
dateTimestamp with resolution on a day level.
intervalDuration of time.
grouphstore, tag_columnSorted set of strings with tag-like “= is contains” semantics.
booleanTRUE or FALSE
jsonJSON data

Arrays

Arrays are an ordered collection of a specific base type. Each base type can have a corresponding array type.

Literals

The table below contains examples on how to declare literals for each type, for use in expressions like SELECT <LITERAL> or in comparisons like WHERE timestamp > timestamp '1 hr ago'.

NameExample
integer1, 4, 23901239412, 0x4B1D
text'Hello, world'
real1.0, 1e30, 314e-2, .25, 5.
datedate <DATE_STRING> (where DATE_STRING is a string that can be parsed into a date, or a relative string like 1 day ago')
timestamptimestamp <TIMESTAMP_STRING> (where TIMESTAMP_STRING is a string that can be parsed into a timestamp, or a relative string like '1 day ago', 'now')
intervalinterval <INTERVAL> (where INTERVAL is a string that can be parsed into a interval, like 1 day, 30s, 2 min')
arraysarray<type>[values...]