Data types
Data types
Boolean
BOOLEAN
BOOLEAN
This type captures boolean values true
and false
.
Integer
BIGINT
BIGINT
A 64-bit signed two’s complement integer with a minimum value of -2^63
and a maximum value of 2^63 - 1
.
Floating-point
DOUBLE
DOUBLE
A double is a 64-bit inexact, variable-precision implementing the IEEE Standard 754 for Binary Floating-Point Arithmetic.
Fixed-precision
DECIMAL
DECIMAL
A fixed precision decimal number. Precision is supported up to 18 digits.
The decimal type takes two literal parameters:
precision - total number of digits
scale - number of digits in fractional part. Scale is optional and defaults to 0.
Example type definitions: DECIMAL(10, 3)
, DECIMAL(18)
Example literals: DECIMAL '10.3'
, DECIMAL '1234567890'
, 1.1
String
STRING
STRING
Variable length of characters.
Date and time
DATE
DATE
Calendar date (year, month, day).
Example: DATE '2001-08-22'
TIMESTAMP
TIMESTAMP
Instant in time that includes the date and time of day without a time zone. Values of this type are parsed and rendered in the session time zone.
Example: TIMESTAMP '2001-08-22 03:04:05.321'
INTERVAL YEAR TO MONTH
INTERVAL YEAR TO MONTH
Span of years and months.
Note that creating columns of this type are not supported. This is usually used when to create a time interval for filtering purposes.
Example: WHERE partition_date > DATE '2022-08-01' - INTERVAL '3' MONTH
INTERVAL DAY TO SECOND
INTERVAL DAY TO SECOND
Span of days, hours, minutes, seconds and milliseconds.
Note that creating columns of this type are not supported. This is usually used when to create a time interval for filtering purposes.
Example: WHERE $commit_time BETWEEN run_start_time() - INTERVAL '2' DAY and run_end_time()
Structural
ARRAY
ARRAY
An array of the given component type.
Note that arrays that only contain null values are treated as null
; while for arrays that contain both null and non-null values, SQLake ignores those null values when working with the array.
Examples: ARRAY[1, 2, 3], [1, 2, 3]
Last updated