abs(x)absolute value
acos(x)inverse cosine
asin(x)inverse sine
atan(x)inverse tangent
atan2(y, x)inverse tangent of y / x
ceil(x)nearest integer greater than or equal to argument
cos(x)cosine
exp(x)exponential
floor(x)nearest integer less than or equal to argument
ln(x)natural logarithm
log10(x)base 10 logarithm
log2(x)base 2 logarithm
power(base, exponent)base raised to the power of exponent
round(x)round to nearest integer
signum(x)sign of the argument (-1, 0, +1)
sin(x)sine
sqrt(x)square root
tan(x)tangent
trunc(x)truncate toward zero
coalesceReturns the first of its arguments that is not null. Null is returned only if all arguments are null. It is often used to substitute a default value for null values when data is retrieved for display.
nullifReturns a null value if value1 equals value2; otherwise it returns value1. This can be used to perform the inverse operation of the coalesce expression. |
asciibit_lengthbtrimchar_lengthcharacter_lengthconcatconcat_wschrinitcapleftlengthlowerlpadltrimmd5octet_lengthrepeatreplacereverserightrpadrtrimdigestsplit_partstarts_withstrpossubstrtranslatetrimupperto_timestampto_timestamp() is similar to the standard SQL function. It performs conversions to type Timestamp(Nanoseconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that conversions from other Timestamp and Int64 types can also be performed using CAST(.. AS Timestamp). However, the conversion functionality here is present for consistency with the other to_timestamp_xx() functions.
to_timestamp_millisto_timestamp_millis() does conversions to type Timestamp(Milliseconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that CAST(.. AS Timestamp) converts to Timestamps with Nanosecond resolution; this function is the only way to convert/cast to millisecond resolution.
to_timestamp_microsto_timestamp_micros() does conversions to type Timestamp(Microseconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that CAST(.. AS Timestamp) converts to Timestamps with Nanosecond resolution; this function is the only way to convert/cast to microsecond resolution.
to_timestamp_secondsto_timestamp_seconds() does conversions to type Timestamp(Seconds, None), from:
1997-01-31T09:26:56.123Z # RCF33391997-01-31T09:26:56.123-05:00 # RCF33391997-01-31 09:26:56.123-05:00 # close to RCF3339 but with a space er than T1997-01-31T09:26:56.123 # close to RCF3339 but no timezone et specified1997-01-31 09:26:56.123 # close to RCF3339 but uses a space and timezone offset1997-01-31 09:26:56 # close to RCF3339, no fractional secondsNote that CAST(.. AS Timestamp) converts to Timestamps with Nanosecond resolution; this function is the only way to convert/cast to seconds resolution.
extractextract(field FROM source)
extract function retrieves subfields such as year or hour from date/time values. source must be a value expression of type timestamp, Date32, or Date64. field is an identifier that selects what field to extract from the source value. The extract function returns values of type u32.year :extract(year FROM to_timestamp('2020-09-08T12:00:00+00:00')) -> 2020month:extract(month FROM to_timestamp('2020-09-08T12:00:00+00:00')) -> 9week :extract(week FROM to_timestamp('2020-09-08T12:00:00+00:00')) -> 37day: extract(day FROM to_timestamp('2020-09-08T12:00:00+00:00')) -> 8hour: extract(hour FROM to_timestamp('2020-09-08T12:00:00+00:00')) -> 12minute: extract(minute FROM to_timestamp('2020-09-08T12:01:00+00:00')) -> 1second: extract(second FROM to_timestamp('2020-09-08T12:00:03+00:00')) -> 3date_partdate_part('field', source)
date_part function is modeled on the postgres equivalent to the SQL-standard function extract. Note that here the field parameter needs to be a string value, not a name. The valid field names for date_part are the same as for extract.date_part('second', to_timestamp('2020-09-08T12:00:12+00:00')) -> 12date_truncdate_binfrom_unixtimenowReturns current time as Timestamp(Nanoseconds, UTC). Returns same value for the function wherever it appears in the statement, using a value chosen at planning time.
arrayarrow_typeofReturns the underlying Arrow type of the the expression:
❯ select arrow_typeof(4 + 4.3); +--------------------------------------+ | arrowtypeof(Int64(4) + Float64(4.3)) | +--------------------------------------+ | Float64 | +--------------------------------------+
in_listrandomsha224sha256sha384sha512structto_hex