| Title: | Documentation for Functions Provided by DuckDB |
|---|---|
| Description: | Lists DuckDB functions for integration in R's help system. |
| Authors: | Kirill Müller [aut, cre] (ORCID: <https://orcid.org/0000-0002-1416-3412>), cynkra GmbH [fnd, cph] (ROR: <https://ror.org/0335t7e62>) |
| Maintainer: | Kirill Müller <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-10-10 07:25:55 UTC |
| Source: | https://github.com/cynkra/dd |
DuckDB function /().
`/`(col0, col1)`/`(col0, col1)
col0 |
|
col1 |
|
FLOAT | DOUBLE | INTERVAL
Bitwise AND.
`&`(left, right)`&`(left, right)
left, right
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
91 & 15
Bitwise shift left.
`<<`(input, col1)`<<`(input, col1)
input |
|
col1 |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
1 << 4
DuckDB function <<=().
`<<=`(col0, col1)`<<=`(col0, col1)
col0, col1
|
|
BOOLEAN
The inet extension (LOAD inet;).
Bitwise shift right.
`>>`(input, col1)`>>`(input, col1)
input |
|
col1 |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
8 >> 2
DuckDB function >>=().
`>>=`(col0, col1)`>>=`(col0, col1)
col0, col1
|
|
BOOLEAN
The inet extension (LOAD inet;).
Bitwise NOT.
`~`(input)`~`(input)
input |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
~15
DuckDB function ~~().
`~~`(col0, col1)`~~`(col0, col1)
col0, col1
|
|
BOOLEAN
DuckDB function ~~*().
`~~*`(col0, col1)`~~*`(col0, col1)
col0, col1
|
|
BOOLEAN
DuckDB function ~~~().
`~~~`(col0, col1)`~~~`(col0, col1)
col0, col1
|
|
BOOLEAN
Absolute value.
abs(x)abs(x)
x |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT
abs(-17.4)
Computes the arccosine of x.
acos(x)acos(x)
x |
|
DOUBLE
acos(0.5)
Computes the inverse hyperbolic cos of x.
acosh(x)acosh(x)
x |
|
DOUBLE
acosh(2.3)
DuckDB function add().
add(col0, col1)add(col0, col1)
col0, col1
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | DATE | INTERVAL | TIMESTAMP | TIME | TIME WITH TIME ZONE | TIMESTAMP WITH TIME ZONE | ANY[] | BIGNUM
add(col0 = TINYINT)
add(col0 = TINYINT, col1 = TINYINT)
add(col0 = SMALLINT)
add(col0 = SMALLINT, col1 = SMALLINT)
add(col0 = INTEGER)
add(col0 = INTEGER, col1 = INTEGER)
add(col0 = BIGINT)
add(col0 = BIGINT, col1 = BIGINT)
add(col0 = HUGEINT)
add(col0 = HUGEINT, col1 = HUGEINT)
add(col0 = FLOAT)
add(col0 = FLOAT, col1 = FLOAT)
add(col0 = DOUBLE)
add(col0 = DOUBLE, col1 = DOUBLE)
add(col0 = DECIMAL)
add(col0 = DECIMAL, col1 = DECIMAL)
add(col0 = UTINYINT)
add(col0 = UTINYINT, col1 = UTINYINT)
add(col0 = USMALLINT)
add(col0 = USMALLINT, col1 = USMALLINT)
add(col0 = UINTEGER)
add(col0 = UINTEGER, col1 = UINTEGER)
add(col0 = UBIGINT)
add(col0 = UBIGINT, col1 = UBIGINT)
add(col0 = UHUGEINT)
add(col0 = UHUGEINT, col1 = UHUGEINT)
add(col0 = DATE, col1 = INTEGER)
add(col0 = INTEGER, col1 = DATE)
add(col0 = INTERVAL, col1 = INTERVAL)
add(col0 = DATE, col1 = INTERVAL)
add(col0 = INTERVAL, col1 = DATE)
add(col0 = TIME, col1 = INTERVAL)
add(col0 = INTERVAL, col1 = TIME)
add(col0 = TIMESTAMP, col1 = INTERVAL)
add(col0 = INTERVAL, col1 = TIMESTAMP)
add(col0 = `TIME WITH TIME ZONE`, col1 = INTERVAL)
add(col0 = INTERVAL, col1 = `TIME WITH TIME ZONE`)
add(col0 = TIME, col1 = DATE)
add(col0 = DATE, col1 = TIME)
add(col0 = `TIME WITH TIME ZONE`, col1 = DATE)
add(col0 = DATE, col1 = `TIME WITH TIME ZONE`)
add()
add(col0 = BIGNUM, col1 = BIGNUM)
DuckDB function add_parquet_key().
add_parquet_key(col0, col1)add_parquet_key(col0, col1)
col0, col1
|
|
Unspecified.
Subtract arguments, resulting in the time difference between the two timestamps.
age(timestamp, timestamp.1)age(timestamp, timestamp.1)
timestamp, timestamp.1
|
|
INTERVAL
age(timestamp = TIMESTAMP)
age(timestamp = TIMESTAMP, timestamp.1 = TIMESTAMP)
age(timestamp = `TIMESTAMP WITH TIME ZONE`)
age(timestamp = `TIMESTAMP WITH TIME ZONE`, timestamp.1 = `TIMESTAMP WITH TIME ZONE`)
age(TIMESTAMP '2001-04-10', TIMESTAMP '1992-09-20')
DuckDB macro ago().
ago(i)ago(i)
i |
Unspecified. |
Unspecified.
Returns the name of a given expression.
alias(expr)alias(expr)
expr |
|
VARCHAR
alias(42 + 1)
DuckDB function all_profiling_output().
all_profiling_output()all_profiling_output()
Unspecified.
Returns the first non-NULL value from arg. This function is affected by ordering.
any_value(arg)any_value(arg)
arg |
|
DECIMAL | ANY
Computes the approximate count of distinct elements using HyperLogLog.
approx_count_distinct(any)approx_count_distinct(any)
any |
|
BIGINT
approx_count_distinct(A)
Computes the approximate quantile using T-Digest.
approx_quantile(x, pos)approx_quantile(x, pos)
x |
|
pos |
|
DECIMAL | SMALLINT | INTEGER | BIGINT | HUGEINT | DOUBLE | DATE | TIME | TIME WITH TIME ZONE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | DECIMAL[] | TINYINT[] | SMALLINT[] | INTEGER[] | BIGINT[] | HUGEINT[] | FLOAT[] | DOUBLE[] | DATE[] | TIME[] | TIME WITH TIME ZONE[] | TIMESTAMP[] | TIMESTAMP WITH TIME ZONE[]
approx_quantile(x, 0.5)
Finds the k approximately most occurring values in the data set.
approx_top_k(val, k)approx_top_k(val, k)
val |
|
k |
|
ANY[]
approx_top_k(x, 5)
Finds the row with the maximum val. Calculates the non-NULL arg expression at that row.
arg_max(arg, val)arg_max(arg, val)
arg |
|
val |
|
INTEGER | BIGINT | DOUBLE | VARCHAR | DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | BLOB | DECIMAL | ANY | ANY[]
arg_max(arg = INTEGER, val = INTEGER)
arg_max(arg = INTEGER, val = BIGINT)
arg_max(arg = INTEGER, val = HUGEINT)
arg_max(arg = INTEGER, val = DOUBLE)
arg_max(arg = INTEGER, val = VARCHAR)
arg_max(arg = INTEGER, val = DATE)
arg_max(arg = INTEGER, val = TIMESTAMP)
arg_max(arg = INTEGER, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = INTEGER, val = BLOB)
arg_max(arg = BIGINT, val = INTEGER)
arg_max(arg = BIGINT, val = BIGINT)
arg_max(arg = BIGINT, val = HUGEINT)
arg_max(arg = BIGINT, val = DOUBLE)
arg_max(arg = BIGINT, val = VARCHAR)
arg_max(arg = BIGINT, val = DATE)
arg_max(arg = BIGINT, val = TIMESTAMP)
arg_max(arg = BIGINT, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = BIGINT, val = BLOB)
arg_max(arg = DOUBLE, val = INTEGER)
arg_max(arg = DOUBLE, val = BIGINT)
arg_max(arg = DOUBLE, val = HUGEINT)
arg_max(arg = DOUBLE, val = DOUBLE)
arg_max(arg = DOUBLE, val = VARCHAR)
arg_max(arg = DOUBLE, val = DATE)
arg_max(arg = DOUBLE, val = TIMESTAMP)
arg_max(arg = DOUBLE, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = DOUBLE, val = BLOB)
arg_max(arg = VARCHAR, val = INTEGER)
arg_max(arg = VARCHAR, val = BIGINT)
arg_max(arg = VARCHAR, val = HUGEINT)
arg_max(arg = VARCHAR, val = DOUBLE)
arg_max(arg = VARCHAR, val = VARCHAR)
arg_max(arg = VARCHAR, val = DATE)
arg_max(arg = VARCHAR, val = TIMESTAMP)
arg_max(arg = VARCHAR, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = VARCHAR, val = BLOB)
arg_max(arg = DATE, val = INTEGER)
arg_max(arg = DATE, val = BIGINT)
arg_max(arg = DATE, val = HUGEINT)
arg_max(arg = DATE, val = DOUBLE)
arg_max(arg = DATE, val = VARCHAR)
arg_max(arg = DATE, val = DATE)
arg_max(arg = DATE, val = TIMESTAMP)
arg_max(arg = DATE, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = DATE, val = BLOB)
arg_max(arg = TIMESTAMP, val = INTEGER)
arg_max(arg = TIMESTAMP, val = BIGINT)
arg_max(arg = TIMESTAMP, val = HUGEINT)
arg_max(arg = TIMESTAMP, val = DOUBLE)
arg_max(arg = TIMESTAMP, val = VARCHAR)
arg_max(arg = TIMESTAMP, val = DATE)
arg_max(arg = TIMESTAMP, val = TIMESTAMP)
arg_max(arg = TIMESTAMP, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = TIMESTAMP, val = BLOB)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = INTEGER)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = BIGINT)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = HUGEINT)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = DOUBLE)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = VARCHAR)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = DATE)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = TIMESTAMP)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = `TIMESTAMP WITH TIME ZONE`, val = BLOB)
arg_max(arg = BLOB, val = INTEGER)
arg_max(arg = BLOB, val = BIGINT)
arg_max(arg = BLOB, val = HUGEINT)
arg_max(arg = BLOB, val = DOUBLE)
arg_max(arg = BLOB, val = VARCHAR)
arg_max(arg = BLOB, val = DATE)
arg_max(arg = BLOB, val = TIMESTAMP)
arg_max(arg = BLOB, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = BLOB, val = BLOB)
arg_max(arg = DECIMAL, val = INTEGER)
arg_max(arg = DECIMAL, val = BIGINT)
arg_max(arg = DECIMAL, val = HUGEINT)
arg_max(arg = DECIMAL, val = DOUBLE)
arg_max(arg = DECIMAL, val = VARCHAR)
arg_max(arg = DECIMAL, val = DATE)
arg_max(arg = DECIMAL, val = TIMESTAMP)
arg_max(arg = DECIMAL, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = DECIMAL, val = BLOB)
arg_max(arg = ANY, val = INTEGER)
arg_max(arg = ANY, val = BIGINT)
arg_max(arg = ANY, val = HUGEINT)
arg_max(arg = ANY, val = DOUBLE)
arg_max(arg = ANY, val = VARCHAR)
arg_max(arg = ANY, val = DATE)
arg_max(arg = ANY, val = TIMESTAMP)
arg_max(arg = ANY, val = `TIMESTAMP WITH TIME ZONE`)
arg_max(arg = ANY, val = BLOB)
arg_max(arg = ANY, val = ANY)
arg_max(arg = ANY, val = ANY, col2 = BIGINT)
arg_max(A, B)
Finds the row with the maximum val. Calculates the arg expression at that row.
arg_max_null(arg, val)arg_max_null(arg, val)
arg |
|
val |
|
INTEGER | BIGINT | DOUBLE | VARCHAR | DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | BLOB | DECIMAL | ANY
arg_max_null(A, B)
Finds the rows with N maximum vals, including nulls. Calculates the arg expression at that row.
arg_max_nulls_last(arg, val)arg_max_nulls_last(arg, val)
arg |
|
val |
|
INTEGER | BIGINT | DOUBLE | VARCHAR | DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | BLOB | DECIMAL | ANY | ANY[]
arg_max_nulls_last(arg = INTEGER, val = INTEGER)
arg_max_nulls_last(arg = INTEGER, val = BIGINT)
arg_max_nulls_last(arg = INTEGER, val = HUGEINT)
arg_max_nulls_last(arg = INTEGER, val = DOUBLE)
arg_max_nulls_last(arg = INTEGER, val = VARCHAR)
arg_max_nulls_last(arg = INTEGER, val = DATE)
arg_max_nulls_last(arg = INTEGER, val = TIMESTAMP)
arg_max_nulls_last(arg = INTEGER, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = INTEGER, val = BLOB)
arg_max_nulls_last(arg = BIGINT, val = INTEGER)
arg_max_nulls_last(arg = BIGINT, val = BIGINT)
arg_max_nulls_last(arg = BIGINT, val = HUGEINT)
arg_max_nulls_last(arg = BIGINT, val = DOUBLE)
arg_max_nulls_last(arg = BIGINT, val = VARCHAR)
arg_max_nulls_last(arg = BIGINT, val = DATE)
arg_max_nulls_last(arg = BIGINT, val = TIMESTAMP)
arg_max_nulls_last(arg = BIGINT, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = BIGINT, val = BLOB)
arg_max_nulls_last(arg = DOUBLE, val = INTEGER)
arg_max_nulls_last(arg = DOUBLE, val = BIGINT)
arg_max_nulls_last(arg = DOUBLE, val = HUGEINT)
arg_max_nulls_last(arg = DOUBLE, val = DOUBLE)
arg_max_nulls_last(arg = DOUBLE, val = VARCHAR)
arg_max_nulls_last(arg = DOUBLE, val = DATE)
arg_max_nulls_last(arg = DOUBLE, val = TIMESTAMP)
arg_max_nulls_last(arg = DOUBLE, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = DOUBLE, val = BLOB)
arg_max_nulls_last(arg = VARCHAR, val = INTEGER)
arg_max_nulls_last(arg = VARCHAR, val = BIGINT)
arg_max_nulls_last(arg = VARCHAR, val = HUGEINT)
arg_max_nulls_last(arg = VARCHAR, val = DOUBLE)
arg_max_nulls_last(arg = VARCHAR, val = VARCHAR)
arg_max_nulls_last(arg = VARCHAR, val = DATE)
arg_max_nulls_last(arg = VARCHAR, val = TIMESTAMP)
arg_max_nulls_last(arg = VARCHAR, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = VARCHAR, val = BLOB)
arg_max_nulls_last(arg = DATE, val = INTEGER)
arg_max_nulls_last(arg = DATE, val = BIGINT)
arg_max_nulls_last(arg = DATE, val = HUGEINT)
arg_max_nulls_last(arg = DATE, val = DOUBLE)
arg_max_nulls_last(arg = DATE, val = VARCHAR)
arg_max_nulls_last(arg = DATE, val = DATE)
arg_max_nulls_last(arg = DATE, val = TIMESTAMP)
arg_max_nulls_last(arg = DATE, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = DATE, val = BLOB)
arg_max_nulls_last(arg = TIMESTAMP, val = INTEGER)
arg_max_nulls_last(arg = TIMESTAMP, val = BIGINT)
arg_max_nulls_last(arg = TIMESTAMP, val = HUGEINT)
arg_max_nulls_last(arg = TIMESTAMP, val = DOUBLE)
arg_max_nulls_last(arg = TIMESTAMP, val = VARCHAR)
arg_max_nulls_last(arg = TIMESTAMP, val = DATE)
arg_max_nulls_last(arg = TIMESTAMP, val = TIMESTAMP)
arg_max_nulls_last(arg = TIMESTAMP, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = TIMESTAMP, val = BLOB)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = INTEGER)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = BIGINT)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = HUGEINT)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = DOUBLE)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = VARCHAR)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = DATE)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = TIMESTAMP)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = BLOB)
arg_max_nulls_last(arg = BLOB, val = INTEGER)
arg_max_nulls_last(arg = BLOB, val = BIGINT)
arg_max_nulls_last(arg = BLOB, val = HUGEINT)
arg_max_nulls_last(arg = BLOB, val = DOUBLE)
arg_max_nulls_last(arg = BLOB, val = VARCHAR)
arg_max_nulls_last(arg = BLOB, val = DATE)
arg_max_nulls_last(arg = BLOB, val = TIMESTAMP)
arg_max_nulls_last(arg = BLOB, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = BLOB, val = BLOB)
arg_max_nulls_last(arg = DECIMAL, val = INTEGER)
arg_max_nulls_last(arg = DECIMAL, val = BIGINT)
arg_max_nulls_last(arg = DECIMAL, val = HUGEINT)
arg_max_nulls_last(arg = DECIMAL, val = DOUBLE)
arg_max_nulls_last(arg = DECIMAL, val = VARCHAR)
arg_max_nulls_last(arg = DECIMAL, val = DATE)
arg_max_nulls_last(arg = DECIMAL, val = TIMESTAMP)
arg_max_nulls_last(arg = DECIMAL, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = DECIMAL, val = BLOB)
arg_max_nulls_last(arg = ANY, val = INTEGER)
arg_max_nulls_last(arg = ANY, val = BIGINT)
arg_max_nulls_last(arg = ANY, val = HUGEINT)
arg_max_nulls_last(arg = ANY, val = DOUBLE)
arg_max_nulls_last(arg = ANY, val = VARCHAR)
arg_max_nulls_last(arg = ANY, val = DATE)
arg_max_nulls_last(arg = ANY, val = TIMESTAMP)
arg_max_nulls_last(arg = ANY, val = `TIMESTAMP WITH TIME ZONE`)
arg_max_nulls_last(arg = ANY, val = BLOB)
arg_max_nulls_last(arg = ANY, val = ANY)
arg_max_nulls_last(arg = ANY, val = ANY, N = BIGINT)
arg_min_null_val(A, B, N)
Finds the row with the minimum val. Calculates the non-NULL arg expression at that row.
arg_min(arg, val)arg_min(arg, val)
arg |
|
val |
|
INTEGER | BIGINT | DOUBLE | VARCHAR | DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | BLOB | DECIMAL | ANY | ANY[]
arg_min(arg = INTEGER, val = INTEGER)
arg_min(arg = INTEGER, val = BIGINT)
arg_min(arg = INTEGER, val = HUGEINT)
arg_min(arg = INTEGER, val = DOUBLE)
arg_min(arg = INTEGER, val = VARCHAR)
arg_min(arg = INTEGER, val = DATE)
arg_min(arg = INTEGER, val = TIMESTAMP)
arg_min(arg = INTEGER, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = INTEGER, val = BLOB)
arg_min(arg = BIGINT, val = INTEGER)
arg_min(arg = BIGINT, val = BIGINT)
arg_min(arg = BIGINT, val = HUGEINT)
arg_min(arg = BIGINT, val = DOUBLE)
arg_min(arg = BIGINT, val = VARCHAR)
arg_min(arg = BIGINT, val = DATE)
arg_min(arg = BIGINT, val = TIMESTAMP)
arg_min(arg = BIGINT, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = BIGINT, val = BLOB)
arg_min(arg = DOUBLE, val = INTEGER)
arg_min(arg = DOUBLE, val = BIGINT)
arg_min(arg = DOUBLE, val = HUGEINT)
arg_min(arg = DOUBLE, val = DOUBLE)
arg_min(arg = DOUBLE, val = VARCHAR)
arg_min(arg = DOUBLE, val = DATE)
arg_min(arg = DOUBLE, val = TIMESTAMP)
arg_min(arg = DOUBLE, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = DOUBLE, val = BLOB)
arg_min(arg = VARCHAR, val = INTEGER)
arg_min(arg = VARCHAR, val = BIGINT)
arg_min(arg = VARCHAR, val = HUGEINT)
arg_min(arg = VARCHAR, val = DOUBLE)
arg_min(arg = VARCHAR, val = VARCHAR)
arg_min(arg = VARCHAR, val = DATE)
arg_min(arg = VARCHAR, val = TIMESTAMP)
arg_min(arg = VARCHAR, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = VARCHAR, val = BLOB)
arg_min(arg = DATE, val = INTEGER)
arg_min(arg = DATE, val = BIGINT)
arg_min(arg = DATE, val = HUGEINT)
arg_min(arg = DATE, val = DOUBLE)
arg_min(arg = DATE, val = VARCHAR)
arg_min(arg = DATE, val = DATE)
arg_min(arg = DATE, val = TIMESTAMP)
arg_min(arg = DATE, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = DATE, val = BLOB)
arg_min(arg = TIMESTAMP, val = INTEGER)
arg_min(arg = TIMESTAMP, val = BIGINT)
arg_min(arg = TIMESTAMP, val = HUGEINT)
arg_min(arg = TIMESTAMP, val = DOUBLE)
arg_min(arg = TIMESTAMP, val = VARCHAR)
arg_min(arg = TIMESTAMP, val = DATE)
arg_min(arg = TIMESTAMP, val = TIMESTAMP)
arg_min(arg = TIMESTAMP, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = TIMESTAMP, val = BLOB)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = INTEGER)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = BIGINT)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = HUGEINT)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = DOUBLE)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = VARCHAR)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = DATE)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = TIMESTAMP)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = `TIMESTAMP WITH TIME ZONE`, val = BLOB)
arg_min(arg = BLOB, val = INTEGER)
arg_min(arg = BLOB, val = BIGINT)
arg_min(arg = BLOB, val = HUGEINT)
arg_min(arg = BLOB, val = DOUBLE)
arg_min(arg = BLOB, val = VARCHAR)
arg_min(arg = BLOB, val = DATE)
arg_min(arg = BLOB, val = TIMESTAMP)
arg_min(arg = BLOB, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = BLOB, val = BLOB)
arg_min(arg = DECIMAL, val = INTEGER)
arg_min(arg = DECIMAL, val = BIGINT)
arg_min(arg = DECIMAL, val = HUGEINT)
arg_min(arg = DECIMAL, val = DOUBLE)
arg_min(arg = DECIMAL, val = VARCHAR)
arg_min(arg = DECIMAL, val = DATE)
arg_min(arg = DECIMAL, val = TIMESTAMP)
arg_min(arg = DECIMAL, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = DECIMAL, val = BLOB)
arg_min(arg = ANY, val = INTEGER)
arg_min(arg = ANY, val = BIGINT)
arg_min(arg = ANY, val = HUGEINT)
arg_min(arg = ANY, val = DOUBLE)
arg_min(arg = ANY, val = VARCHAR)
arg_min(arg = ANY, val = DATE)
arg_min(arg = ANY, val = TIMESTAMP)
arg_min(arg = ANY, val = `TIMESTAMP WITH TIME ZONE`)
arg_min(arg = ANY, val = BLOB)
arg_min(arg = ANY, val = ANY)
arg_min(arg = ANY, val = ANY, col2 = BIGINT)
arg_min(A, B)
Finds the row with the minimum val. Calculates the arg expression at that row.
arg_min_null(arg, val)arg_min_null(arg, val)
arg |
|
val |
|
INTEGER | BIGINT | DOUBLE | VARCHAR | DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | BLOB | DECIMAL | ANY
arg_min_null(A, B)
Finds the rows with N minimum vals, including nulls. Calculates the arg expression at that row.
arg_min_nulls_last(arg, val)arg_min_nulls_last(arg, val)
arg |
|
val |
|
INTEGER | BIGINT | DOUBLE | VARCHAR | DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE | BLOB | DECIMAL | ANY | ANY[]
arg_min_nulls_last(arg = INTEGER, val = INTEGER)
arg_min_nulls_last(arg = INTEGER, val = BIGINT)
arg_min_nulls_last(arg = INTEGER, val = HUGEINT)
arg_min_nulls_last(arg = INTEGER, val = DOUBLE)
arg_min_nulls_last(arg = INTEGER, val = VARCHAR)
arg_min_nulls_last(arg = INTEGER, val = DATE)
arg_min_nulls_last(arg = INTEGER, val = TIMESTAMP)
arg_min_nulls_last(arg = INTEGER, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = INTEGER, val = BLOB)
arg_min_nulls_last(arg = BIGINT, val = INTEGER)
arg_min_nulls_last(arg = BIGINT, val = BIGINT)
arg_min_nulls_last(arg = BIGINT, val = HUGEINT)
arg_min_nulls_last(arg = BIGINT, val = DOUBLE)
arg_min_nulls_last(arg = BIGINT, val = VARCHAR)
arg_min_nulls_last(arg = BIGINT, val = DATE)
arg_min_nulls_last(arg = BIGINT, val = TIMESTAMP)
arg_min_nulls_last(arg = BIGINT, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = BIGINT, val = BLOB)
arg_min_nulls_last(arg = DOUBLE, val = INTEGER)
arg_min_nulls_last(arg = DOUBLE, val = BIGINT)
arg_min_nulls_last(arg = DOUBLE, val = HUGEINT)
arg_min_nulls_last(arg = DOUBLE, val = DOUBLE)
arg_min_nulls_last(arg = DOUBLE, val = VARCHAR)
arg_min_nulls_last(arg = DOUBLE, val = DATE)
arg_min_nulls_last(arg = DOUBLE, val = TIMESTAMP)
arg_min_nulls_last(arg = DOUBLE, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = DOUBLE, val = BLOB)
arg_min_nulls_last(arg = VARCHAR, val = INTEGER)
arg_min_nulls_last(arg = VARCHAR, val = BIGINT)
arg_min_nulls_last(arg = VARCHAR, val = HUGEINT)
arg_min_nulls_last(arg = VARCHAR, val = DOUBLE)
arg_min_nulls_last(arg = VARCHAR, val = VARCHAR)
arg_min_nulls_last(arg = VARCHAR, val = DATE)
arg_min_nulls_last(arg = VARCHAR, val = TIMESTAMP)
arg_min_nulls_last(arg = VARCHAR, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = VARCHAR, val = BLOB)
arg_min_nulls_last(arg = DATE, val = INTEGER)
arg_min_nulls_last(arg = DATE, val = BIGINT)
arg_min_nulls_last(arg = DATE, val = HUGEINT)
arg_min_nulls_last(arg = DATE, val = DOUBLE)
arg_min_nulls_last(arg = DATE, val = VARCHAR)
arg_min_nulls_last(arg = DATE, val = DATE)
arg_min_nulls_last(arg = DATE, val = TIMESTAMP)
arg_min_nulls_last(arg = DATE, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = DATE, val = BLOB)
arg_min_nulls_last(arg = TIMESTAMP, val = INTEGER)
arg_min_nulls_last(arg = TIMESTAMP, val = BIGINT)
arg_min_nulls_last(arg = TIMESTAMP, val = HUGEINT)
arg_min_nulls_last(arg = TIMESTAMP, val = DOUBLE)
arg_min_nulls_last(arg = TIMESTAMP, val = VARCHAR)
arg_min_nulls_last(arg = TIMESTAMP, val = DATE)
arg_min_nulls_last(arg = TIMESTAMP, val = TIMESTAMP)
arg_min_nulls_last(arg = TIMESTAMP, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = TIMESTAMP, val = BLOB)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = INTEGER)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = BIGINT)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = HUGEINT)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = DOUBLE)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = VARCHAR)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = DATE)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = TIMESTAMP)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = `TIMESTAMP WITH TIME ZONE`, val = BLOB)
arg_min_nulls_last(arg = BLOB, val = INTEGER)
arg_min_nulls_last(arg = BLOB, val = BIGINT)
arg_min_nulls_last(arg = BLOB, val = HUGEINT)
arg_min_nulls_last(arg = BLOB, val = DOUBLE)
arg_min_nulls_last(arg = BLOB, val = VARCHAR)
arg_min_nulls_last(arg = BLOB, val = DATE)
arg_min_nulls_last(arg = BLOB, val = TIMESTAMP)
arg_min_nulls_last(arg = BLOB, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = BLOB, val = BLOB)
arg_min_nulls_last(arg = DECIMAL, val = INTEGER)
arg_min_nulls_last(arg = DECIMAL, val = BIGINT)
arg_min_nulls_last(arg = DECIMAL, val = HUGEINT)
arg_min_nulls_last(arg = DECIMAL, val = DOUBLE)
arg_min_nulls_last(arg = DECIMAL, val = VARCHAR)
arg_min_nulls_last(arg = DECIMAL, val = DATE)
arg_min_nulls_last(arg = DECIMAL, val = TIMESTAMP)
arg_min_nulls_last(arg = DECIMAL, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = DECIMAL, val = BLOB)
arg_min_nulls_last(arg = ANY, val = INTEGER)
arg_min_nulls_last(arg = ANY, val = BIGINT)
arg_min_nulls_last(arg = ANY, val = HUGEINT)
arg_min_nulls_last(arg = ANY, val = DOUBLE)
arg_min_nulls_last(arg = ANY, val = VARCHAR)
arg_min_nulls_last(arg = ANY, val = DATE)
arg_min_nulls_last(arg = ANY, val = TIMESTAMP)
arg_min_nulls_last(arg = ANY, val = `TIMESTAMP WITH TIME ZONE`)
arg_min_nulls_last(arg = ANY, val = BLOB)
arg_min_nulls_last(arg = ANY, val = ANY)
arg_min_nulls_last(arg = ANY, val = ANY, N = BIGINT)
arg_min_null_val(A, B, N)
Returns a LIST containing all the values of a column.
array_agg(arg)array_agg(arg)
arg |
|
T[]
array_agg(A) list(A)
DuckDB macro array_append().
array_append(arr, el)array_append(arr, el)
arr, el
|
Unspecified. |
Unspecified.
Computes the cosine distance between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.
array_cosine_distance(array1, array2)array_cosine_distance(array1, array2)
array1, array2
|
|
FLOAT | DOUBLE
array_cosine_distance(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
Other array:
array_cosine_similarity(),
array_cross_product(),
array_distance(),
array_inner_product(),
array_negative_inner_product(),
array_value()
Computes the cosine similarity between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.
array_cosine_similarity(array1, array2)array_cosine_similarity(array1, array2)
array1, array2
|
|
FLOAT | DOUBLE
array_cosine_similarity(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
Other array:
array_cosine_distance(),
array_cross_product(),
array_distance(),
array_inner_product(),
array_negative_inner_product(),
array_value()
Computes the cross product of two arrays of size 3. The array elements can not be NULL.
array_cross_product(array, array.1)array_cross_product(array, array.1)
array, array.1
|
|
FLOAT[3] | DOUBLE[3]
array_cross_product(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
Other array:
array_cosine_distance(),
array_cosine_similarity(),
array_distance(),
array_inner_product(),
array_negative_inner_product(),
array_value()
Computes the distance between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.
array_distance(array1, array2)array_distance(array1, array2)
array1, array2
|
|
FLOAT | DOUBLE
array_distance(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
Other array:
array_cosine_distance(),
array_cosine_similarity(),
array_cross_product(),
array_inner_product(),
array_negative_inner_product(),
array_value()
array_extract(list = `T[]`, index = BIGINT): Extracts the indexth (1-based) value from the list.
array_extract(string = VARCHAR, index = BIGINT): Extracts a single character from a string using a (1-based) index.
array_extract(struct = STRUCT, entry = VARCHAR): Extracts the named entry from the STRUCT.
array_extract(struct = STRUCT, index = BIGINT): Extracts the entry from an unnamed STRUCT (tuple) using an index (1-based).
array_extract(list, index)array_extract(list, index)
list |
|
index |
|
T | VARCHAR | ANY
array_extract(list = `T[]`, index = BIGINT)
array_extract(string = VARCHAR, index = BIGINT)
array_extract(struct = STRUCT, entry = VARCHAR)
array_extract(struct = STRUCT, index = BIGINT)
array_extract('DuckDB', 2)
array_extract({'i': 3, 'v2': 3, 'v3': 0}, 'i')
array_extract(row(42, 84), 1)
array_extract([4, 5, 6], 3)
Other list:
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Other string:
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Computes the inner product between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.
array_inner_product(array1, array2)array_inner_product(array1, array2)
array1, array2
|
|
FLOAT | DOUBLE
array_inner_product(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
Other array:
array_cosine_distance(),
array_cosine_similarity(),
array_cross_product(),
array_distance(),
array_negative_inner_product(),
array_value()
array_length(list = `ANY[]`): Returns the length of the list.
array_length(list = `ANY[]`, dimension = BIGINT): array_length for lists with dimensions other than 1 not implemented.
array_length(list, dimension)array_length(list, dimension)
list |
|
dimension |
|
BIGINT
array_length(list = `ANY[]`)
array_length(list = `ANY[]`, dimension = BIGINT)
array_length([1, 2, 3])
Other list:
array_extract(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Computes the negative inner product between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.
array_negative_inner_product(array1, array2)array_negative_inner_product(array1, array2)
array1, array2
|
|
FLOAT | DOUBLE
array_negative_inner_product(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))
Other array:
array_cosine_distance(),
array_cosine_similarity(),
array_cross_product(),
array_distance(),
array_inner_product(),
array_value()
DuckDB macro array_pop_back().
array_pop_back(arr)array_pop_back(arr)
arr |
Unspecified. |
Unspecified.
DuckDB macro array_pop_front().
array_pop_front(arr)array_pop_front(arr)
arr |
Unspecified. |
Unspecified.
DuckDB macro array_prepend().
array_prepend(el, arr)array_prepend(el, arr)
el, arr
|
Unspecified. |
Unspecified.
DuckDB macro array_push_back().
array_push_back(arr, e)array_push_back(arr, e)
arr, e
|
Unspecified. |
Unspecified.
DuckDB macro array_push_front().
array_push_front(arr, e)array_push_front(arr, e)
arr, e
|
Unspecified. |
Unspecified.
DuckDB macro array_reverse().
array_reverse(l)array_reverse(l)
l |
Unspecified. |
Unspecified.
DuckDB function array_to_json().
array_to_json()array_to_json()
JSON
The json extension (LOAD json;).
DuckDB macro array_to_string().
array_to_string(arr, sep)array_to_string(arr, sep)
arr, sep
|
Unspecified. |
Unspecified.
DuckDB macro array_to_string_comma_default().
array_to_string_comma_default(arr, sep)array_to_string_comma_default(arr, sep)
arr, sep
|
Unspecified. |
Unspecified.
Creates an ARRAY containing the argument values.
array_value()array_value()
ARRAY
array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT)
Other array:
array_cosine_distance(),
array_cosine_similarity(),
array_cross_product(),
array_distance(),
array_inner_product(),
array_negative_inner_product()
DuckDB function arrow_scan().
arrow_scan(col0, col1, col2)arrow_scan(col0, col1, col2)
col0, col1, col2
|
|
Unspecified.
DuckDB function arrow_scan_dumb().
arrow_scan_dumb(col0, col1, col2)arrow_scan_dumb(col0, col1, col2)
col0, col1, col2
|
|
Unspecified.
DuckDB function ->>().
`->>`(col0, col1)`->>`(col0, col1)
col0 |
|
col1 |
|
VARCHAR | VARCHAR[]
The json extension (LOAD json;).
Returns an integer that represents the Unicode code point of the first character of the string.
ascii(string)ascii(string)
string |
|
INTEGER
ascii('Ω')
Other string:
array_extract(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Computes the arcsine of x.
asin(x)asin(x)
x |
|
DOUBLE
asin(0.5)
Computes the inverse hyperbolic sin of x.
asinh(x)asinh(x)
x |
|
DOUBLE
asinh(0.5)
Computes the arctangent of x.
atan(x)atan(x)
x |
|
DOUBLE
atan(0.5)
Computes the arctangent (y, x).
atan2(y, x)atan2(y, x)
y, x
|
|
DOUBLE
atan2(1.0, 0.0)
Computes the inverse hyperbolic tan of x.
atanh(x)atanh(x)
x |
|
DOUBLE
atanh(0.5)
Calculates the average value for all tuples in x.
avg(x)avg(x)
x |
|
DECIMAL | DOUBLE | INTERVAL | TIMESTAMP | TIMESTAMP WITH TIME ZONE | TIME | TIME WITH TIME ZONE
SUM(x) / COUNT(*)
Draws a band whose width is proportional to (x - min) and equal to width characters when x = max. width defaults to 80.
bar(x, min, max, width)bar(x, min, max, width)
x, min, max, width
|
|
VARCHAR
bar(x = DOUBLE, min = DOUBLE, max = DOUBLE, width = DOUBLE)
bar(x = DOUBLE, min = DOUBLE, max = DOUBLE)
bar(5, 0, 20, 10)
Other string:
array_extract(),
ascii(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
bin(string = VARCHAR): Converts the string to binary representation.
bin(value = BIGNUM), bin(value = UBIGINT), bin(value = BIGINT), bin(value = HUGEINT), bin(value = UHUGEINT): Converts the value to binary representation.
bin(value)bin(value)
value |
|
VARCHAR
bin(string = VARCHAR)
bin(value = BIGNUM)
bin(value = UBIGINT)
bin(value = BIGINT)
bin(value = HUGEINT)
bin(value = UHUGEINT)
bin('Aa')
bin(42)
Other numeric:
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hex(),
least(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns the bitwise AND of all bits in a given expression.
bit_and(arg)bit_and(arg)
arg |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
bit_and(A)
Returns the number of bits that are set.
bit_count(x)bit_count(x)
x |
|
TINYINT | BIGINT
bit_count(31)
bit_length(string = VARCHAR): Number of bits in a string.
bit_length(bit = BIT): Returns the bit-length of the bit argument.
bit_length(string)bit_length(string)
string |
|
BIGINT
bit_length(string = VARCHAR)
bit_length(bit = BIT)
bit_length('abc')
bit_length(42::TINYINT::BIT)
Other numeric:
bin(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hex(),
least(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns the bitwise OR of all bits in a given expression.
bit_or(arg)bit_or(arg)
arg |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
bit_or(A)
Returns first starting index of the specified substring within bits, or zero if it is not present. The first (leftmost) bit is indexed 1.
bit_position(substring, bitstring)bit_position(substring, bitstring)
substring, bitstring
|
|
INTEGER
bit_position('010'::BIT, '1110101'::BIT)
Returns the bitwise XOR of all bits in a given expression.
bit_xor(arg)bit_xor(arg)
arg |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
bit_xor(A)
Pads the bitstring until the specified length.
bitstring(bitstring, length)bitstring(bitstring, length)
bitstring |
|
length |
|
BIT
bitstring('1010'::BIT, 7)
Returns a bitstring with bits set for each distinct value.
bitstring_agg(arg, col1, col2)bitstring_agg(arg, col1, col2)
arg, col1, col2
|
|
BIT
bitstring_agg(arg = TINYINT)
bitstring_agg(arg = TINYINT, col1 = TINYINT, col2 = TINYINT)
bitstring_agg(arg = SMALLINT)
bitstring_agg(arg = SMALLINT, col1 = SMALLINT, col2 = SMALLINT)
bitstring_agg(arg = INTEGER)
bitstring_agg(arg = INTEGER, col1 = INTEGER, col2 = INTEGER)
bitstring_agg(arg = BIGINT)
bitstring_agg(arg = BIGINT, col1 = BIGINT, col2 = BIGINT)
bitstring_agg(arg = HUGEINT)
bitstring_agg(arg = HUGEINT, col1 = HUGEINT, col2 = HUGEINT)
bitstring_agg(arg = UTINYINT)
bitstring_agg(arg = UTINYINT, col1 = UTINYINT, col2 = UTINYINT)
bitstring_agg(arg = USMALLINT)
bitstring_agg(arg = USMALLINT, col1 = USMALLINT, col2 = USMALLINT)
bitstring_agg(arg = UINTEGER)
bitstring_agg(arg = UINTEGER, col1 = UINTEGER, col2 = UINTEGER)
bitstring_agg(arg = UBIGINT)
bitstring_agg(arg = UBIGINT, col1 = UBIGINT, col2 = UBIGINT)
bitstring_agg(arg = UHUGEINT)
bitstring_agg(arg = UHUGEINT, col1 = UHUGEINT, col2 = UHUGEINT)
bitstring_agg(A)
Returns TRUE if every input value is TRUE, otherwise FALSE.
bool_and(arg)bool_and(arg)
arg |
|
BOOLEAN
bool_and(A)
Returns TRUE if any input value is TRUE, otherwise FALSE.
bool_or(arg)bool_or(arg)
arg |
|
BOOLEAN
bool_or(A)
DuckDB function broadcast().
broadcast(col0)broadcast(col0)
col0 |
|
INET
The inet extension (LOAD inet;).
Whether or not we can implicitly cast from the source type to the other type.
can_cast_implicitly(source_type, target_type)can_cast_implicitly(source_type, target_type)
source_type, target_type
|
|
BOOLEAN
can_cast_implicitly(NULL::INTEGER, NULL::BIGINT)
Returns the size of the map (or the number of entries in the map).
cardinality(map)cardinality(map)
map |
|
UBIGINT
cardinality( map([4, 2], ['a', 'b']) );
Casts the first argument to the type of the second argument.
cast_to_type(param, type)cast_to_type(param, type)
param, type
|
|
ANY
cast_to_type('42', NULL::INTEGER)
Returns the cube root of x.
cbrt(x)cbrt(x)
x |
|
DOUBLE
cbrt(8)
Rounds the number up.
ceil(x)ceil(x)
x |
|
FLOAT | DOUBLE | DECIMAL
ceil(17.4)
Extract the century component from a date or timestamp.
century(ts)century(ts)
ts |
|
BIGINT
century(timestamp '2021-08-03 11:59:44.123456')
DuckDB function check_peg_parser().
check_peg_parser(col0)check_peg_parser(col0)
col0 |
|
Unspecified.
The autocomplete extension (LOAD autocomplete;).
DuckDB function checkpoint().
checkpoint(col0)checkpoint(col0)
col0 |
|
Unspecified.
checkpoint()
checkpoint(col0 = VARCHAR)
Returns a character which is corresponding the ASCII code value or Unicode code point.
chr(code_point)chr(code_point)
code_point |
|
VARCHAR
chr(65)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB macro col_description().
col_description(table_oid, column_number)col_description(table_oid, column_number)
table_oid, column_number
|
Unspecified. |
Unspecified.
DuckDB function collations().
collations()collations()
Unspecified.
DuckDB function combine().
combine(col0, col1)combine(col0, col1)
col0 |
|
col1 |
|
AGGREGATE_STATE<?>
Concatenates multiple strings or lists. NULL inputs are skipped. See also operator ||.
concat(value)concat(value)
value |
|
ANY
concat('Hello', ' ', 'World')
concat([1, 2, 3], NULL, [4, 5, 6])
Other list:
array_extract(),
array_length(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Concatenates many strings, separated by separator. NULL inputs are skipped.
concat_ws(separator, string)concat_ws(separator, string)
separator |
|
string |
|
VARCHAR
concat_ws(', ', 'Banana', 'Apple', 'Melon')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
If arg2 is NULL, return NULL. Otherwise, return arg1.
constant_or_null(arg1, arg2)constant_or_null(arg1, arg2)
arg1, arg2
|
|
ANY
constant_or_null(42, NULL)
contains(string = VARCHAR, search_string = VARCHAR): Returns true if search_string is found within string.
contains(list = `T[]`, element = T): Returns true if the list contains the element.
contains(map = `MAP(K, V)`, key = K): Checks if a map contains a given key.
contains(col0 = STRUCT, col1 = ANY): (Description missing.)
contains(string, search_string)contains(string, search_string)
string, search_string
|
|
BOOLEAN
contains(string = VARCHAR, search_string = VARCHAR)
contains(list = `T[]`, element = T)
contains(map = `MAP(K, V)`, key = K)
contains(col0 = STRUCT, col1 = ANY)
contains('abc', 'a')
contains([1, 2, NULL], 1)
contains(MAP {'key1': 10, 'key2': 20, 'key3': 30}, 'key2')
Other list:
array_extract(),
array_length(),
concat(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function copy_database().
copy_database(col0, col1)copy_database(col0, col1)
col0, col1
|
|
Unspecified.
DuckDB macro copy_dir().
copy_dir(src_dir, dst_dir)copy_dir(src_dir, dst_dir)
src_dir, dst_dir
|
Unspecified. |
Unspecified.
The delta extension (LOAD delta;).
Returns the correlation coefficient for non-NULL pairs in a group.
corr(y, x)corr(y, x)
y, x
|
|
DOUBLE
COVAR_POP(y, x) / (STDDEV_POP(x) * STDDEV_POP(y))
Computes the cos of x.
cos(x)cos(x)
x |
|
DOUBLE
cos(90)
Computes the hyperbolic cos of x.
cosh(x)cosh(x)
x |
|
DOUBLE
cosh(1)
Computes the cotangent of x.
cot(x)cot(x)
x |
|
DOUBLE
cot(0.5)
Returns the number of non-NULL values in arg.
count(arg)count(arg)
arg |
|
BIGINT
count(arg = ANY)
count()
count(A)
Counts the total number of TRUE values for a boolean column.
count_if(arg)count_if(arg)
arg |
|
HUGEINT
count_if(A)
DuckDB function count_star().
count_star()count_star()
BIGINT
Returns the population covariance of input values.
covar_pop(y, x)covar_pop(y, x)
y, x
|
|
DOUBLE
(SUM(x*y) - SUM(x) * SUM(y) / COUNT(*)) / COUNT(*)
Returns the sample covariance for non-NULL pairs in a group.
covar_samp(y, x)covar_samp(y, x)
y, x
|
|
DOUBLE
(SUM(x*y) - SUM(x) * SUM(y) / COUNT(*)) / (COUNT(*) - 1)
DuckDB function create_fts_index().
create_fts_index(col0, col1, overwrite, lower, ignore, stopwords, strip_accents, stemmer)create_fts_index(col0, col1, overwrite, lower, ignore, stopwords, strip_accents, stemmer)
col0 |
|
col1 |
|
overwrite |
|
lower |
|
ignore |
|
stopwords |
|
strip_accents |
|
stemmer |
|
Unspecified.
The fts extension (LOAD fts;).
Constructs a binary-comparable sort key based on a set of input parameters and sort qualifiers.
create_sort_key(parameters...)create_sort_key(parameters...)
parameters... |
|
BLOB
create_sort_key('A', 'DESC')
DuckDB function cume_dist().
cume_dist()cume_dist()
DOUBLE
DuckDB macro current_catalog().
current_catalog()current_catalog()
Unspecified.
Get the current connection_id.
current_connection_id()current_connection_id()
UBIGINT
current_connection_id()
Returns the name of the currently active database.
current_database()current_database()
VARCHAR
current_database()
DuckDB function current_date().
current_date()current_date()
DATE
The icu extension (LOAD icu;).
DuckDB function current_localtime().
current_localtime()current_localtime()
TIME
The icu extension (LOAD icu;).
DuckDB function current_localtimestamp().
current_localtimestamp()current_localtimestamp()
TIMESTAMP
The icu extension (LOAD icu;).
Returns the current query as a string.
current_query()current_query()
VARCHAR
current_query()
Get the current query_id.
current_query_id()current_query_id()
UBIGINT
current_query_id()
DuckDB macro current_role().
current_role()current_role()
Unspecified.
Returns the name of the currently active schema. Default is main.
current_schema()current_schema()
VARCHAR
current_schema()
Returns list of schemas. Pass a parameter of True to include implicit schemas.
current_schemas(include_implicit)current_schemas(include_implicit)
include_implicit |
|
VARCHAR[]
current_schemas(true)
Returns the current value of the configuration setting.
current_setting(setting_name)current_setting(setting_name)
setting_name |
|
ANY
current_setting('access_mode')
Get the current global transaction_id.
current_transaction_id()current_transaction_id()
UBIGINT
current_transaction_id()
DuckDB macro current_user().
current_user()current_user()
Unspecified.
Return the current value of the sequence. Note that nextval must be called at least once prior to calling currval.
currval(sequence_name)currval(sequence_name)
sequence_name |
|
BIGINT
currval('my_sequence_name')
Extension of Levenshtein distance to also include transposition of adjacent characters as an allowed edit operation. In other words, the minimum number of edit operations (insertions, deletions, substitutions or transpositions) required to change one string to another. Characters of different cases (e.g., a and A) are considered different.
damerau_levenshtein(s1, s2)damerau_levenshtein(s1, s2)
s1, s2
|
|
BIGINT
damerau_levenshtein('duckdb', 'udckbd')
Other text_similarity:
hamming(),
jaccard(),
jaro_similarity(),
jaro_winkler_similarity(),
levenshtein()
DuckDB function database_list().
database_list()database_list()
Unspecified.
DuckDB function database_size().
database_size()database_size()
Unspecified.
DuckDB macro date_add().
date_add(date, interval)date_add(date, interval)
date, interval
|
Unspecified. |
Unspecified.
The number of partition boundaries between the timestamps.
date_diff(part, startdate, enddate)date_diff(part, startdate, enddate)
part |
|
startdate |
|
enddate |
|
BIGINT
date_diff('hour', TIMESTAMPTZ '1992-09-30 23:59:59', TIMESTAMPTZ '1992-10-01 01:58:00')
Get subfield (equivalent to extract).
date_part(ts, col1)date_part(ts, col1)
ts |
|
col1 |
|
STRUCT() | BIGINT
date_part('minute', TIMESTAMP '1992-09-20 20:38:40')
The number of complete partitions between the timestamps.
date_sub(part, startdate, enddate)date_sub(part, startdate, enddate)
part |
|
startdate |
|
enddate |
|
BIGINT
date_sub('hour', TIMESTAMPTZ '1992-09-30 23:59:59', TIMESTAMPTZ '1992-10-01 01:58:00')
Truncate to specified precision.
date_trunc(part, timestamp)date_trunc(part, timestamp)
part |
|
timestamp |
|
TIMESTAMP | INTERVAL | TIMESTAMP WITH TIME ZONE
date_trunc('hour', TIMESTAMPTZ '1992-09-20 20:38:40')
Extract the day component from a date or timestamp.
day(ts)day(ts)
ts |
|
BIGINT
day(timestamp '2021-08-03 11:59:44.123456')
The (English) name of the weekday.
dayname(ts)dayname(ts)
ts |
|
VARCHAR
dayname(TIMESTAMP '1992-03-22')
Extract the dayofmonth component from a date or timestamp.
dayofmonth(ts)dayofmonth(ts)
ts |
|
BIGINT
dayofmonth(timestamp '2021-08-03 11:59:44.123456')
Extract the dayofweek component from a date or timestamp.
dayofweek(ts)dayofweek(ts)
ts |
|
BIGINT
dayofweek(timestamp '2021-08-03 11:59:44.123456')
Extract the dayofyear component from a date or timestamp.
dayofyear(ts)dayofyear(ts)
ts |
|
BIGINT
dayofyear(timestamp '2021-08-03 11:59:44.123456')
DuckDB macro days_in_month().
days_in_month(date)days_in_month(date)
date |
Unspecified. |
Unspecified.
DuckDB function dbgen().
dbgen(step, suffix, schema, catalog, overwrite, children, sf)dbgen(step, suffix, schema, catalog, overwrite, children, sf)
step |
|
suffix |
|
schema |
|
catalog |
|
overwrite |
|
children |
|
sf |
|
Unspecified.
The tpch extension (LOAD tpch;).
A list of known DuckDB functions, as provided by DuckDB 1.5.5.
dddd
dd[1:3]dd[1:3]
Extract the decade component from a date or timestamp.
decade(ts)decade(ts)
ts |
|
BIGINT
decade(timestamp '2021-08-03 11:59:44.123456')
Converts blob to VARCHAR. Invalid UTF-8 is handled based on the error behavior argument. Can be 'strict' (default, fail), 'replace' to replace invalid characters with '?', or 'ignore' to skip invalid characters.
decode(blob, varchar)decode(blob, varchar)
blob |
|
varchar |
|
VARCHAR
decode(blob = BLOB)
decode(blob = BLOB, varchar = VARCHAR)
decode('\xC3\xBC'::BLOB)
decode('\xA0'::BLOB, 'replace')
decode('\xA0'::BLOB, 'ignore')
Other blob:
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Converts radians to degrees.
degrees(x)degrees(x)
x |
|
DOUBLE
degrees(pi())
DuckDB function delta_domain_metadata().
delta_domain_metadata(col0, version)delta_domain_metadata(col0, version)
col0 |
|
version |
|
Unspecified.
The delta extension (LOAD delta;).
DuckDB macro delta_filter_pushdown_log().
delta_filter_pushdown_log()delta_filter_pushdown_log()
Unspecified.
The delta extension (LOAD delta;).
DuckDB macro delta_filter_pushdown_log_tpcds().
delta_filter_pushdown_log_tpcds()delta_filter_pushdown_log_tpcds()
Unspecified.
The delta extension (LOAD delta;).
DuckDB function delta_get_transaction_version().
delta_get_transaction_version(col0, col1)delta_get_transaction_version(col0, col1)
col0, col1
|
|
Unspecified.
The delta extension (LOAD delta;).
DuckDB function delta_list_files().
delta_list_files(col0, version, delete_count, transform_expression)delta_list_files(col0, version, delete_count, transform_expression)
col0 |
|
version |
|
delete_count |
|
transform_expression |
|
Unspecified.
The delta extension (LOAD delta;).
DuckDB function delta_scan().
delta_scan( col0, version, log_tail, pushdown_partition_info, can_have_nan, filename, pushdown_filters, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types )delta_scan( col0, version, log_tail, pushdown_partition_info, can_have_nan, filename, pushdown_filters, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types )
col0 |
|
version |
|
log_tail |
|
pushdown_partition_info |
|
can_have_nan |
|
filename |
|
pushdown_filters |
|
union_by_name |
|
debug_use_openssl |
|
hive_partitioning |
|
parquet_version |
|
encryption_config |
|
hive_types_autocast |
|
binary_as_string |
|
explicit_cardinality |
|
compression |
|
file_row_number |
|
hive_types |
|
Unspecified.
The delta extension (LOAD delta;).
DuckDB function delta_set_transaction_version().
delta_set_transaction_version(col0, col1, col2, col3)delta_set_transaction_version(col0, col1, col2, col3)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
Unspecified.
The delta extension (LOAD delta;).
DuckDB function dense_rank().
dense_rank()dense_rank()
BIGINT
DuckDB function disable_checkpoint_on_shutdown().
disable_checkpoint_on_shutdown()disable_checkpoint_on_shutdown()
Unspecified.
DuckDB function disable_logging().
disable_logging()disable_logging()
Unspecified.
DuckDB function disable_object_cache().
disable_object_cache()disable_object_cache()
Unspecified.
DuckDB function disable_optimizer().
disable_optimizer()disable_optimizer()
Unspecified.
DuckDB function disable_peg_parser().
disable_peg_parser()disable_peg_parser()
Unspecified.
The autocomplete extension (LOAD autocomplete;).
DuckDB function disable_print_progress_bar().
disable_print_progress_bar()disable_print_progress_bar()
Unspecified.
DuckDB function disable_profile().
disable_profile()disable_profile()
Unspecified.
DuckDB function disable_profiling().
disable_profiling()disable_profiling()
Unspecified.
DuckDB function disable_progress_bar().
disable_progress_bar()disable_progress_bar()
Unspecified.
DuckDB function disable_verification().
disable_verification()disable_verification()
Unspecified.
DuckDB function disable_verify_external().
disable_verify_external()disable_verify_external()
Unspecified.
DuckDB function disable_verify_fetch_row().
disable_verify_fetch_row()disable_verify_fetch_row()
Unspecified.
DuckDB function disable_verify_parallelism().
disable_verify_parallelism()disable_verify_parallelism()
Unspecified.
DuckDB function disable_verify_serializer().
disable_verify_serializer()disable_verify_serializer()
Unspecified.
DuckDB function divide().
divide(col0, col1)divide(col0, col1)
col0, col1
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT
DuckDB function drop_fts_index().
drop_fts_index(col0)drop_fts_index(col0)
col0 |
|
Unspecified.
The fts extension (LOAD fts;).
DuckDB function dsdgen().
dsdgen(suffix, schema, catalog, keys, overwrite, sf)dsdgen(suffix, schema, catalog, keys, overwrite, sf)
suffix |
|
schema |
|
catalog |
|
keys |
|
overwrite |
|
sf |
|
Unspecified.
The tpcds extension (LOAD tpcds;).
DuckDB function duckdb_approx_database_count().
duckdb_approx_database_count()duckdb_approx_database_count()
Unspecified.
DuckDB function duckdb_columns().
duckdb_columns()duckdb_columns()
Unspecified.
DuckDB function duckdb_connection_count().
duckdb_connection_count()duckdb_connection_count()
Unspecified.
DuckDB function duckdb_constraints().
duckdb_constraints()duckdb_constraints()
Unspecified.
DuckDB function duckdb_coordinate_systems().
duckdb_coordinate_systems()duckdb_coordinate_systems()
Unspecified.
DuckDB function duckdb_databases().
duckdb_databases()duckdb_databases()
Unspecified.
DuckDB function duckdb_dependencies().
duckdb_dependencies()duckdb_dependencies()
Unspecified.
DuckDB function duckdb_extensions().
duckdb_extensions()duckdb_extensions()
Unspecified.
DuckDB function duckdb_external_file_cache().
duckdb_external_file_cache()duckdb_external_file_cache()
Unspecified.
DuckDB function duckdb_functions().
duckdb_functions()duckdb_functions()
Unspecified.
DuckDB function duckdb_indexes().
duckdb_indexes()duckdb_indexes()
Unspecified.
DuckDB function duckdb_keywords().
duckdb_keywords()duckdb_keywords()
Unspecified.
DuckDB function duckdb_log_contexts().
duckdb_log_contexts()duckdb_log_contexts()
Unspecified.
DuckDB function duckdb_logs().
duckdb_logs(denormalized_table)duckdb_logs(denormalized_table)
denormalized_table |
|
Unspecified.
DuckDB macro duckdb_logs_parsed().
duckdb_logs_parsed(log_type)duckdb_logs_parsed(log_type)
log_type |
Unspecified. |
Unspecified.
DuckDB function duckdb_memory().
duckdb_memory()duckdb_memory()
Unspecified.
DuckDB function duckdb_optimizers().
duckdb_optimizers()duckdb_optimizers()
Unspecified.
DuckDB function duckdb_prepared_statements().
duckdb_prepared_statements()duckdb_prepared_statements()
Unspecified.
DuckDB macro duckdb_profiling_settings().
duckdb_profiling_settings()duckdb_profiling_settings()
Unspecified.
Returns a text description of the PROJ library version that this instance of DuckDB was compiled against.
DuckDB_PROJ_Compiled_Version()DuckDB_PROJ_Compiled_Version()
VARCHAR
The spatial extension (LOAD spatial;).
SELECT duckdb_proj_compiled_version(); -- +--------------------------------+ -- | duckdb_proj_compiled_version() | -- | varchar | -- +--------------------------------+ -- | Rel. 9.1.1, December 1st, 2022 | -- +--------------------------------+
Returns a text description of the PROJ library version that is being used by this instance of DuckDB.
DuckDB_Proj_Version()DuckDB_Proj_Version()
VARCHAR
The spatial extension (LOAD spatial;).
SELECT duckdb_proj_version(); -- +-----------------------+ -- | duckdb_proj_version() | -- | varchar | -- +-----------------------+ -- | 9.1.1 |geometry_always_xy -- +-----------------------+
DuckDB function duckdb_schemas().
duckdb_schemas()duckdb_schemas()
Unspecified.
DuckDB function duckdb_secret_types().
duckdb_secret_types()duckdb_secret_types()
Unspecified.
DuckDB function duckdb_secrets().
duckdb_secrets(redact)duckdb_secrets(redact)
redact |
|
Unspecified.
DuckDB function duckdb_sequences().
duckdb_sequences()duckdb_sequences()
Unspecified.
DuckDB function duckdb_settings().
duckdb_settings()duckdb_settings()
Unspecified.
DuckDB function duckdb_table_sample().
duckdb_table_sample(col0)duckdb_table_sample(col0)
col0 |
|
Unspecified.
DuckDB function duckdb_tables().
duckdb_tables()duckdb_tables()
Unspecified.
DuckDB function duckdb_temporary_files().
duckdb_temporary_files()duckdb_temporary_files()
Unspecified.
DuckDB function duckdb_types().
duckdb_types()duckdb_types()
Unspecified.
DuckDB function duckdb_variables().
duckdb_variables()duckdb_variables()
Unspecified.
DuckDB function duckdb_views().
duckdb_views()duckdb_views()
Unspecified.
DuckDB function ducklake_add_data_files().
ducklake_add_data_files( col0, col1, col2, schema, hive_partitioning, ignore_extra_columns, allow_missing )ducklake_add_data_files( col0, col1, col2, schema, hive_partitioning, ignore_extra_columns, allow_missing )
col0 |
|
col1 |
|
col2 |
|
schema |
|
hive_partitioning |
|
ignore_extra_columns |
|
allow_missing |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_cleanup_old_files().
ducklake_cleanup_old_files(col0, dry_run, cleanup_all, older_than)ducklake_cleanup_old_files(col0, dry_run, cleanup_all, older_than)
col0 |
|
dry_run |
|
cleanup_all |
|
older_than |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_commit().
ducklake_commit(col0, col1, retry_backoff, retry_wait_ms, max_retry_count)ducklake_commit(col0, col1, retry_backoff, retry_wait_ms, max_retry_count)
col0 |
|
col1 |
|
retry_backoff |
|
retry_wait_ms |
|
max_retry_count |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_current_snapshot().
ducklake_current_snapshot(col0)ducklake_current_snapshot(col0)
col0 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_delete_orphaned_files().
ducklake_delete_orphaned_files(col0, dry_run, cleanup_all, older_than)ducklake_delete_orphaned_files(col0, dry_run, cleanup_all, older_than)
col0 |
|
dry_run |
|
cleanup_all |
|
older_than |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_expire_snapshots().
ducklake_expire_snapshots(col0, dry_run, versions, older_than)ducklake_expire_snapshots(col0, dry_run, versions, older_than)
col0 |
|
dry_run |
|
versions |
|
older_than |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_flush_inlined_data().
ducklake_flush_inlined_data(col0, table_name, schema_name)ducklake_flush_inlined_data(col0, table_name, schema_name)
col0, table_name, schema_name
|
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_last_committed_snapshot().
ducklake_last_committed_snapshot(col0)ducklake_last_committed_snapshot(col0)
col0 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_list_files().
ducklake_list_files(col0, col1, snapshot_time, snapshot_version, schema)ducklake_list_files(col0, col1, snapshot_time, snapshot_version, schema)
col0 |
|
col1 |
|
snapshot_time |
|
snapshot_version |
|
schema |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_merge_adjacent_files().
ducklake_merge_adjacent_files( col0, col1, schema, max_compacted_files, max_file_size, min_file_size )ducklake_merge_adjacent_files( col0, col1, schema, max_compacted_files, max_file_size, min_file_size )
col0 |
|
col1 |
|
schema |
|
max_compacted_files |
|
max_file_size |
|
min_file_size |
|
Unspecified.
ducklake_merge_adjacent_files(col0 = VARCHAR, col1 = VARCHAR, schema = VARCHAR, max_compacted_files = UBIGINT, max_file_size = UBIGINT, min_file_size = UBIGINT)
ducklake_merge_adjacent_files(col0 = VARCHAR, max_compacted_files = UBIGINT, max_file_size = UBIGINT, min_file_size = UBIGINT)
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_options().
ducklake_options(col0)ducklake_options(col0)
col0 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_rewrite_data_files().
ducklake_rewrite_data_files(col0, col1, schema, delete_threshold)ducklake_rewrite_data_files(col0, col1, schema, delete_threshold)
col0 |
|
col1 |
|
schema |
|
delete_threshold |
|
Unspecified.
ducklake_rewrite_data_files(col0 = VARCHAR, col1 = VARCHAR, schema = VARCHAR, delete_threshold = DOUBLE)
ducklake_rewrite_data_files(col0 = VARCHAR, delete_threshold = DOUBLE)
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_scan().
ducklake_scan( col0, can_have_nan, filename, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types, schema )ducklake_scan( col0, can_have_nan, filename, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types, schema )
col0 |
|
can_have_nan |
|
filename |
|
union_by_name |
|
debug_use_openssl |
|
hive_partitioning |
|
parquet_version |
|
encryption_config |
|
hive_types_autocast |
|
binary_as_string |
|
explicit_cardinality |
|
compression |
|
file_row_number |
|
hive_types |
|
schema |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_set_commit_message().
ducklake_set_commit_message(col0, col1, col2, extra_info)ducklake_set_commit_message(col0, col1, col2, extra_info)
col0, col1, col2, extra_info
|
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_set_option().
ducklake_set_option(col0, col1, col2, schema, table_name)ducklake_set_option(col0, col1, col2, schema, table_name)
col0 |
|
col1 |
|
col2 |
|
schema |
|
table_name |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_settings().
ducklake_settings(col0)ducklake_settings(col0)
col0 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_snapshots().
ducklake_snapshots(col0)ducklake_snapshots(col0)
col0 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB macro ducklake_table_changes().
ducklake_table_changes(catalog, schema_name, table_name, start_snapshot, end_snapshot)ducklake_table_changes(catalog, schema_name, table_name, start_snapshot, end_snapshot)
catalog, schema_name, table_name, start_snapshot, end_snapshot
|
Unspecified. |
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_table_deletions().
ducklake_table_deletions(col0, col1, col2, col3, col4)ducklake_table_deletions(col0, col1, col2, col3, col4)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_table_info().
ducklake_table_info(col0)ducklake_table_info(col0)
col0 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function ducklake_table_insertions().
ducklake_table_insertions(col0, col1, col2, col3, col4)ducklake_table_insertions(col0, col1, col2, col3, col4)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
Unspecified.
The ducklake extension (LOAD ducklake;).
DuckDB function enable_checkpoint_on_shutdown().
enable_checkpoint_on_shutdown()enable_checkpoint_on_shutdown()
Unspecified.
DuckDB function enable_logging().
enable_logging( storage_buffer_size, storage_normalize, storage_path, storage_config, storage, level )enable_logging( storage_buffer_size, storage_normalize, storage_path, storage_config, storage, level )
storage_buffer_size |
|
storage_normalize |
|
storage_path |
|
storage_config |
|
storage |
|
level |
|
Unspecified.
DuckDB function enable_object_cache().
enable_object_cache()enable_object_cache()
Unspecified.
DuckDB function enable_optimizer().
enable_optimizer()enable_optimizer()
Unspecified.
DuckDB function enable_peg_parser().
enable_peg_parser()enable_peg_parser()
Unspecified.
The autocomplete extension (LOAD autocomplete;).
DuckDB function enable_print_progress_bar().
enable_print_progress_bar()enable_print_progress_bar()
Unspecified.
DuckDB function enable_profile().
enable_profile()enable_profile()
Unspecified.
DuckDB function enable_profiling().
enable_profiling(mode, metrics, save_location, coverage, format)enable_profiling(mode, metrics, save_location, coverage, format)
mode |
|
metrics |
|
save_location |
|
coverage |
|
format |
|
Unspecified.
enable_profiling(mode = VARCHAR, metrics = ANY, save_location = VARCHAR, coverage = VARCHAR, format = VARCHAR)
enable_profiling()
DuckDB function enable_progress_bar().
enable_progress_bar()enable_progress_bar()
Unspecified.
DuckDB function enable_verification().
enable_verification()enable_verification()
Unspecified.
Converts the string to BLOB. Converts UTF-8 characters into literal encoding.
encode(string)encode(string)
string |
|
BLOB
encode('my_string_with_ü')
Other blob:
decode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Returns the log-2 entropy of count input-values.
entropy(x)entropy(x)
x |
|
DOUBLE
Returns the numeric value backing the given enum value.
enum_code(enum)enum_code(enum)
enum |
|
ANY
enum_code('happy'::mood)
Returns the first value of the input enum type.
enum_first(enum)enum_first(enum)
enum |
|
VARCHAR
enum_first(NULL::mood)
Returns the last value of the input enum type.
enum_last(enum)enum_last(enum)
enum |
|
VARCHAR
enum_last(NULL::mood)
Returns all values of the input enum type as an array.
enum_range(enum)enum_range(enum)
enum |
|
VARCHAR[]
enum_range(NULL::mood)
Returns the range between the two given enum values as an array. The values must be of the same enum type. When the first parameter is NULL, the result starts with the first value of the enum type. When the second parameter is NULL, the result ends with the last value of the enum type.
enum_range_boundary(start, end)enum_range_boundary(start, end)
start, end
|
|
VARCHAR[]
enum_range_boundary(NULL, 'happy'::mood)
Extract the epoch component from a temporal type.
epoch(temporal)epoch(temporal)
temporal |
|
DOUBLE
epoch(timestamp '2021-08-03 11:59:44.123456')
Extract the epoch component in milliseconds from a temporal type.
epoch_ms(temporal)epoch_ms(temporal)
temporal |
|
BIGINT | TIMESTAMP
epoch_ms(timestamp '2021-08-03 11:59:44.123456')
Extract the epoch component in nanoseconds from a temporal type.
epoch_ns(temporal)epoch_ns(temporal)
temporal |
|
BIGINT
epoch_ns(timestamp '2021-08-03 11:59:44.123456')
Extract the epoch component in microseconds from a temporal type.
epoch_us(temporal)epoch_us(temporal)
temporal |
|
BIGINT
epoch_us(timestamp '2021-08-03 11:59:44.123456')
Generates bin_count equi-width bins between the min and max. If enabled nice_rounding makes the numbers more readable/less jagged.
equi_width_bins(min, max, bin_count, nice_rounding)equi_width_bins(min, max, bin_count, nice_rounding)
min |
|
max |
|
bin_count |
|
nice_rounding |
|
ANY[]
equi_width_bins(0, 10, 2, true)
Extract the era component from a date or timestamp.
era(ts)era(ts)
ts |
|
BIGINT
era(timestamp '2021-08-03 11:59:44.123456')
Throws the given error message.
error(message)error(message)
message |
|
"NULL"
error('access_mode')
Rounds x to next even number by rounding away from zero.
even(x)even(x)
x |
|
DOUBLE
even(2.9)
DuckDB function excel_text().
excel_text(col0, col1)excel_text(col0, col1)
col0 |
|
col1 |
|
VARCHAR
The excel extension (LOAD excel;).
Computes e to the power of x.
exp(x)exp(x)
x |
|
DOUBLE
exp(1)
DuckDB function extension_versions().
extension_versions()extension_versions()
Unspecified.
Factorial of x. Computes the product of the current integer and all integers below it.
factorial(x)factorial(x)
x |
|
HUGEINT
4!
DuckDB function family().
family(col0)family(col0)
col0 |
|
UTINYINT
The inet extension (LOAD inet;).
Calculates the average using a more accurate floating point summation (Kahan Sum).
favg(x)favg(x)
x |
|
DOUBLE
favg(A)
DuckDB macro fdiv().
fdiv(x, y)fdiv(x, y)
x, y
|
Unspecified. |
Unspecified.
DuckDB function fill().
fill(col0)fill(col0)
col0 |
|
T
DuckDB function finalize().
finalize(col0)finalize(col0)
col0 |
|
INVALID
Returns the first value (NULL or non-NULL) from arg. This function is affected by ordering.
first(arg)first(arg)
arg |
|
DECIMAL | ANY | T
first(arg = DECIMAL)
first(arg = ANY)
first(col0 = T)
first(A)
DuckDB function first_value().
first_value(col0)first_value(col0)
col0 |
|
T
Flattens a nested list by one level.
flatten(nested_list)flatten(nested_list)
nested_list |
|
T[]
flatten([[1, 2, 3], [4, 5]])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Rounds the number down.
floor(x)floor(x)
x |
|
FLOAT | DOUBLE | DECIMAL
floor(17.4)
DuckDB macro fmod().
fmod(x, y)fmod(x, y)
x, y
|
Unspecified. |
Unspecified.
DuckDB function force_checkpoint().
force_checkpoint()force_checkpoint()
Unspecified.
force_checkpoint()
force_checkpoint(col0 = VARCHAR)
Formats a string using the fmt syntax.
format(format)format(format)
format |
|
VARCHAR
format('Benchmark "{}" took {} seconds', 'CSV', 42)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Converts integer to a human-readable representation using units based on powers of 2 (KiB, MiB, GiB, etc.).
format_bytes(integer)format_bytes(integer)
integer |
|
VARCHAR
format_bytes(16_000)
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
greatest(),
hex(),
least(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB macro format_pg_type().
format_pg_type(logical_type, type_name)format_pg_type(logical_type, type_name)
logical_type, type_name
|
Unspecified. |
Unspecified.
DuckDB macro format_type().
format_type(type_oid, typemod)format_type(type_oid, typemod)
type_oid, typemod
|
Unspecified. |
Unspecified.
Converts integer to a human-readable representation using units based on powers of 10 (KB, MB, GB, etc.).
formatReadableDecimalSize(integer)formatReadableDecimalSize(integer)
integer |
|
VARCHAR
formatReadableDecimalSize(16_000)
Other numeric:
bin(),
bit_length(),
format_bytes(),
greatest(),
hex(),
least(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Converts a base64 encoded string to a character string (BLOB).
from_base64(string)from_base64(string)
string |
|
BLOB
from_base64('QQ==')
Other blob:
decode(),
encode(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function from_json().
from_json(col0, col1)from_json(col0, col1)
col0 |
|
col1 |
|
ANY
The json extension (LOAD json;).
DuckDB function from_json_strict().
from_json_strict(col0, col1)from_json_strict(col0, col1)
col0 |
|
col1 |
|
ANY
The json extension (LOAD json;).
DuckDB function functions().
functions()functions()
Unspecified.
Interpolation of (x-1) factorial (so decimal inputs are allowed).
gamma(x)gamma(x)
x |
|
DOUBLE
gamma(5.5)
Creates a list of values between start and stop - the stop parameter is inclusive.
generate_series(start, stop, step)generate_series(start, stop, step)
start |
|
stop |
|
step |
|
BIGINT[] | TIMESTAMP[] | TIMESTAMP WITH TIME ZONE[]
generate_series(col0 = BIGINT)
generate_series(col0 = BIGINT, col1 = BIGINT)
generate_series(col0 = BIGINT, col1 = BIGINT, col2 = BIGINT)
generate_series(col0 = TIMESTAMP, col1 = TIMESTAMP, col2 = INTERVAL)
generate_series(col0 = `TIMESTAMP WITH TIME ZONE`, col1 = `TIMESTAMP WITH TIME ZONE`, col2 = INTERVAL)
generate_series(start = BIGINT)
generate_series(start = BIGINT, stop = BIGINT)
generate_series(start = BIGINT, stop = BIGINT, step = BIGINT)
generate_series(start = TIMESTAMP, stop = TIMESTAMP, step = INTERVAL)
generate_series(start = `TIMESTAMP WITH TIME ZONE`, stop = `TIMESTAMP WITH TIME ZONE`, step = INTERVAL)
generate_series(col0 = BIGINT): built in
generate_series(col0 = BIGINT, col1 = BIGINT): built in
generate_series(col0 = BIGINT, col1 = BIGINT, col2 = BIGINT): built in
generate_series(col0 = TIMESTAMP, col1 = TIMESTAMP, col2 = INTERVAL): built in
generate_series(col0 = `TIMESTAMP WITH TIME ZONE`, col1 = `TIMESTAMP WITH TIME ZONE`, col2 = INTERVAL): icu
generate_series(start = BIGINT): built in
generate_series(start = BIGINT, stop = BIGINT): built in
generate_series(start = BIGINT, stop = BIGINT, step = BIGINT): built in
generate_series(start = TIMESTAMP, stop = TIMESTAMP, step = INTERVAL): built in
generate_series(start = `TIMESTAMP WITH TIME ZONE`, stop = `TIMESTAMP WITH TIME ZONE`, step = INTERVAL): built in
generate_series(2, 5, 3)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro generate_subscripts().
generate_subscripts(arr, dim)generate_subscripts(arr, dim)
arr, dim
|
Unspecified. |
Unspecified.
DuckDB macro geomean().
geomean(x)geomean(x)
x |
Unspecified. |
Unspecified.
DuckDB macro geometric_mean().
geometric_mean(x)geometric_mean(x)
x |
Unspecified. |
Unspecified.
Extracts the nth bit from bitstring; the first (leftmost) bit is indexed 0.
get_bit(bitstring, index)get_bit(bitstring, index)
bitstring |
|
index |
|
INTEGER
get_bit('0110010'::BIT, 2)
DuckDB macro get_block_size().
get_block_size(db_name)get_block_size(db_name)
db_name |
Unspecified. |
Unspecified.
DuckDB function get_current_time().
get_current_time()get_current_time()
TIME WITH TIME ZONE
The icu extension (LOAD icu;).
Returns the current timestamp.
get_current_timestamp()get_current_timestamp()
TIMESTAMP WITH TIME ZONE
get_current_timestamp()
DuckDB function get_delta_test_expression().
get_delta_test_expression()get_delta_test_expression()
VARCHAR[]
The delta extension (LOAD delta;).
Returns the type of the result of the expression.
get_type(expression)get_type(expression)
expression |
|
TYPE
get_type('abc')
DuckDB function get_ui_url().
get_ui_url()get_ui_url()
Unspecified.
The ui extension (LOAD ui;).
DuckDB function getvariable().
getvariable(col0)getvariable(col0)
col0 |
|
ANY
DuckDB function glob().
glob(col0)glob(col0)
col0 |
|
Unspecified.
Returns the largest value. For strings lexicographical ordering is used. Note that lowercase characters are considered “larger” than uppercase characters and collations are not supported.
greatest(arg1)greatest(arg1)
arg1 |
|
ANY
greatest(42, 84)
greatest('abc', 'bcd', 'cde', 'EFG')
Other aggregate:
least()
Other date:
least()
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
hex(),
least(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Other timestamp:
least()
Computes the greatest common divisor of x and y.
greatest_common_divisor(x, y)greatest_common_divisor(x, y)
x, y
|
|
BIGINT | HUGEINT
greatest_common_divisor(42, 57)
The Hamming distance between to strings, i.e., the number of positions with different characters for two strings of equal length. Strings must be of equal length. Characters of different cases (e.g., a and A) are considered different.
hamming(s1, s2)hamming(s1, s2)
s1, s2
|
|
BIGINT
hamming('duck', 'luck')
Other text_similarity:
damerau_levenshtein(),
jaccard(),
jaro_similarity(),
jaro_winkler_similarity(),
levenshtein()
DuckDB function has_any_column_privilege().
has_any_column_privilege(user, table, privilege)has_any_column_privilege(user, table, privilege)
user, table, privilege
|
Unspecified. |
Unspecified.
has_any_column_privilege(table, privilege)
has_any_column_privilege(user, table, privilege)
DuckDB function has_column_privilege().
has_column_privilege(user, table, column, privilege)has_column_privilege(user, table, column, privilege)
user, table, column, privilege
|
Unspecified. |
Unspecified.
has_column_privilege(table, column, privilege)
has_column_privilege(user, table, column, privilege)
DuckDB function has_database_privilege().
has_database_privilege(user, database, privilege)has_database_privilege(user, database, privilege)
user, database, privilege
|
Unspecified. |
Unspecified.
has_database_privilege(database, privilege)
has_database_privilege(user, database, privilege)
DuckDB function has_foreign_data_wrapper_privilege().
has_foreign_data_wrapper_privilege(user, fdw, privilege)has_foreign_data_wrapper_privilege(user, fdw, privilege)
user, fdw, privilege
|
Unspecified. |
Unspecified.
has_foreign_data_wrapper_privilege(fdw, privilege)
has_foreign_data_wrapper_privilege(user, fdw, privilege)
DuckDB function has_function_privilege().
has_function_privilege(user, function., privilege)has_function_privilege(user, function., privilege)
user, function., privilege
|
Unspecified. |
Unspecified.
has_function_privilege(function., privilege)
has_function_privilege(user, function., privilege)
DuckDB function has_language_privilege().
has_language_privilege(user, language, privilege)has_language_privilege(user, language, privilege)
user, language, privilege
|
Unspecified. |
Unspecified.
has_language_privilege(language, privilege)
has_language_privilege(user, language, privilege)
DuckDB function has_schema_privilege().
has_schema_privilege(user, schema, privilege)has_schema_privilege(user, schema, privilege)
user, schema, privilege
|
Unspecified. |
Unspecified.
has_schema_privilege(schema, privilege)
has_schema_privilege(user, schema, privilege)
DuckDB function has_sequence_privilege().
has_sequence_privilege(user, sequence, privilege)has_sequence_privilege(user, sequence, privilege)
user, sequence, privilege
|
Unspecified. |
Unspecified.
has_sequence_privilege(sequence, privilege)
has_sequence_privilege(user, sequence, privilege)
DuckDB function has_server_privilege().
has_server_privilege(user, server, privilege)has_server_privilege(user, server, privilege)
user, server, privilege
|
Unspecified. |
Unspecified.
has_server_privilege(server, privilege)
has_server_privilege(user, server, privilege)
DuckDB function has_table_privilege().
has_table_privilege(user, table, privilege)has_table_privilege(user, table, privilege)
user, table, privilege
|
Unspecified. |
Unspecified.
has_table_privilege(table, privilege)
has_table_privilege(user, table, privilege)
DuckDB function has_tablespace_privilege().
has_tablespace_privilege(user, tablespace, privilege)has_tablespace_privilege(user, tablespace, privilege)
user, tablespace, privilege
|
Unspecified. |
Unspecified.
has_tablespace_privilege(tablespace, privilege)
has_tablespace_privilege(user, tablespace, privilege)
Returns a UBIGINT with the hash of the value. Note that this is not a cryptographic hash.
hash(value)hash(value)
value |
|
UBIGINT
hash('🦆')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
hex(string = VARCHAR): Converts the string to hexadecimal representation.
hex(value = BIGNUM), hex(value = BIGINT), hex(value = UBIGINT), hex(value = HUGEINT), hex(value = UHUGEINT): Converts the value to VARCHAR using hexadecimal representation.
hex(blob = BLOB): Converts blob to VARCHAR using hexadecimal encoding.
hex(value)hex(value)
value |
|
VARCHAR
hex(string = VARCHAR)
hex(value = BIGNUM)
hex(blob = BLOB)
hex(value = BIGINT)
hex(value = UBIGINT)
hex(value = HUGEINT)
hex(value = UHUGEINT)
hex('Hello')
hex(42)
hex('\xAA\xBB'::BLOB)
Other blob:
decode(),
encode(),
from_base64(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
least(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns a LIST of STRUCTs with the fields bucket and count.
histogram(source, col_name, bin_count, technique)histogram(source, col_name, bin_count, technique)
source, col_name, bin_count, technique
|
Unspecified. |
MAP
histogram(arg = ANY, col1 = `ANY[]`)
histogram(arg = ANY)
histogram(source, col_name, bin_count, technique)
histogram(A)
Returns a LIST of STRUCTs with the fields bucket and count matching the buckets exactly.
histogram_exact(arg, bins)histogram_exact(arg, bins)
arg |
|
bins |
|
MAP
histogram_exact(A, [0, 1, 2])
DuckDB macro histogram_values().
histogram_values(source, col_name, bin_count, technique)histogram_values(source, col_name, bin_count, technique)
source, col_name, bin_count, technique
|
Unspecified. |
Unspecified.
DuckDB function hnsw_compact_index().
hnsw_compact_index(col0)hnsw_compact_index(col0)
col0 |
|
Unspecified.
The vss extension (LOAD vss;).
DuckDB function hnsw_index_scan().
hnsw_index_scan()hnsw_index_scan()
Unspecified.
The vss extension (LOAD vss;).
DuckDB function host().
host(col0)host(col0)
col0 |
|
VARCHAR
The inet extension (LOAD inet;).
Extract the hour component from a date or timestamp.
hour(ts)hour(ts)
ts |
|
BIGINT
hour(timestamp '2021-08-03 11:59:44.123456')
DuckDB function html_escape().
html_escape(col0, col1)html_escape(col0, col1)
col0 |
|
col1 |
|
VARCHAR
html_escape(col0 = VARCHAR)
html_escape(col0 = VARCHAR, col1 = BOOLEAN)
The inet extension (LOAD inet;).
DuckDB function html_unescape().
html_unescape(col0)html_unescape(col0)
col0 |
|
VARCHAR
The inet extension (LOAD inet;).
DuckDB function iceberg_bucket().
iceberg_bucket(col0, col1)iceberg_bucket(col0, col1)
col0 |
|
col1 |
|
INTEGER
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_column_stats().
iceberg_column_stats( col0, snapshot_from_timestamp, snapshot_from_id, version_name_format, version, metadata_compression_codec, allow_moved_paths )iceberg_column_stats( col0, snapshot_from_timestamp, snapshot_from_id, version_name_format, version, metadata_compression_codec, allow_moved_paths )
col0 |
|
snapshot_from_timestamp |
|
snapshot_from_id |
|
version_name_format |
|
version |
|
metadata_compression_codec |
|
allow_moved_paths |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_load_table_response().
iceberg_load_table_response(col0)iceberg_load_table_response(col0)
col0 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_metadata().
iceberg_metadata( col0, snapshot_from_timestamp, snapshot_from_id, version_name_format, version, metadata_compression_codec, allow_moved_paths )iceberg_metadata( col0, snapshot_from_timestamp, snapshot_from_id, version_name_format, version, metadata_compression_codec, allow_moved_paths )
col0 |
|
snapshot_from_timestamp |
|
snapshot_from_id |
|
version_name_format |
|
version |
|
metadata_compression_codec |
|
allow_moved_paths |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_partition_stats().
iceberg_partition_stats( col0, snapshot_from_timestamp, snapshot_from_id, version_name_format, version, metadata_compression_codec, allow_moved_paths )iceberg_partition_stats( col0, snapshot_from_timestamp, snapshot_from_id, version_name_format, version, metadata_compression_codec, allow_moved_paths )
col0 |
|
snapshot_from_timestamp |
|
snapshot_from_id |
|
version_name_format |
|
version |
|
metadata_compression_codec |
|
allow_moved_paths |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_scan().
iceberg_scan( col0, snapshot_from_timestamp, version, metadata_compression_codec, mode, can_have_nan, allow_moved_paths, filename, union_by_name, snapshot_from_id, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, version_name_format, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types )iceberg_scan( col0, snapshot_from_timestamp, version, metadata_compression_codec, mode, can_have_nan, allow_moved_paths, filename, union_by_name, snapshot_from_id, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, version_name_format, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types )
col0 |
|
snapshot_from_timestamp |
|
version |
|
metadata_compression_codec |
|
mode |
|
can_have_nan |
|
allow_moved_paths |
|
filename |
|
union_by_name |
|
snapshot_from_id |
|
debug_use_openssl |
|
hive_partitioning |
|
parquet_version |
|
encryption_config |
|
version_name_format |
|
hive_types_autocast |
|
binary_as_string |
|
explicit_cardinality |
|
compression |
|
file_row_number |
|
hive_types |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_schema_properties().
iceberg_schema_properties(col0)iceberg_schema_properties(col0)
col0 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_snapshots().
iceberg_snapshots(col0, version_name_format, version, metadata_compression_codec)iceberg_snapshots(col0, version_name_format, version, metadata_compression_codec)
col0, version_name_format, version, metadata_compression_codec
|
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_table_properties().
iceberg_table_properties(col0)iceberg_table_properties(col0)
col0 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_to_ducklake().
iceberg_to_ducklake(col0, col1, skip_tables)iceberg_to_ducklake(col0, col1, skip_tables)
col0 |
|
col1 |
|
skip_tables |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_truncate().
iceberg_truncate(col0, col1)iceberg_truncate(col0, col1)
col0 |
|
col1 |
|
INTEGER | BIGINT | VARCHAR | BLOB | DECIMAL
The iceberg extension (LOAD iceberg;).
DuckDB function iceberg_verify_equality_deletes().
iceberg_verify_equality_deletes()iceberg_verify_equality_deletes()
BOOLEAN
The iceberg extension (LOAD iceberg;).
DuckDB function icu_calendar_names().
icu_calendar_names()icu_calendar_names()
Unspecified.
The icu extension (LOAD icu;).
DuckDB function icu_collate_af().
icu_collate_af(col0)icu_collate_af(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_am().
icu_collate_am(col0)icu_collate_am(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ar().
icu_collate_ar(col0)icu_collate_ar(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ar_sa().
icu_collate_ar_sa(col0)icu_collate_ar_sa(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_as().
icu_collate_as(col0)icu_collate_as(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_az().
icu_collate_az(col0)icu_collate_az(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_be().
icu_collate_be(col0)icu_collate_be(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_bg().
icu_collate_bg(col0)icu_collate_bg(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_bn().
icu_collate_bn(col0)icu_collate_bn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_bo().
icu_collate_bo(col0)icu_collate_bo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_br().
icu_collate_br(col0)icu_collate_br(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_bs().
icu_collate_bs(col0)icu_collate_bs(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ca().
icu_collate_ca(col0)icu_collate_ca(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ceb().
icu_collate_ceb(col0)icu_collate_ceb(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_chr().
icu_collate_chr(col0)icu_collate_chr(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_cs().
icu_collate_cs(col0)icu_collate_cs(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_cy().
icu_collate_cy(col0)icu_collate_cy(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_da().
icu_collate_da(col0)icu_collate_da(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_de().
icu_collate_de(col0)icu_collate_de(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_de_at().
icu_collate_de_at(col0)icu_collate_de_at(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_dsb().
icu_collate_dsb(col0)icu_collate_dsb(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_dz().
icu_collate_dz(col0)icu_collate_dz(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ee().
icu_collate_ee(col0)icu_collate_ee(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_el().
icu_collate_el(col0)icu_collate_el(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_en().
icu_collate_en(col0)icu_collate_en(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_en_us().
icu_collate_en_us(col0)icu_collate_en_us(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_eo().
icu_collate_eo(col0)icu_collate_eo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_es().
icu_collate_es(col0)icu_collate_es(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_et().
icu_collate_et(col0)icu_collate_et(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fa().
icu_collate_fa(col0)icu_collate_fa(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fa_af().
icu_collate_fa_af(col0)icu_collate_fa_af(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ff().
icu_collate_ff(col0)icu_collate_ff(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fi().
icu_collate_fi(col0)icu_collate_fi(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fil().
icu_collate_fil(col0)icu_collate_fil(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fo().
icu_collate_fo(col0)icu_collate_fo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fr().
icu_collate_fr(col0)icu_collate_fr(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fr_ca().
icu_collate_fr_ca(col0)icu_collate_fr_ca(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_fy().
icu_collate_fy(col0)icu_collate_fy(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ga().
icu_collate_ga(col0)icu_collate_ga(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_gl().
icu_collate_gl(col0)icu_collate_gl(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_gu().
icu_collate_gu(col0)icu_collate_gu(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ha().
icu_collate_ha(col0)icu_collate_ha(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_haw().
icu_collate_haw(col0)icu_collate_haw(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_he().
icu_collate_he(col0)icu_collate_he(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_he_il().
icu_collate_he_il(col0)icu_collate_he_il(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_hi().
icu_collate_hi(col0)icu_collate_hi(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_hr().
icu_collate_hr(col0)icu_collate_hr(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_hsb().
icu_collate_hsb(col0)icu_collate_hsb(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_hu().
icu_collate_hu(col0)icu_collate_hu(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_hy().
icu_collate_hy(col0)icu_collate_hy(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_id().
icu_collate_id(col0)icu_collate_id(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_id_id().
icu_collate_id_id(col0)icu_collate_id_id(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ig().
icu_collate_ig(col0)icu_collate_ig(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_is().
icu_collate_is(col0)icu_collate_is(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_it().
icu_collate_it(col0)icu_collate_it(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ja().
icu_collate_ja(col0)icu_collate_ja(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ka().
icu_collate_ka(col0)icu_collate_ka(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_kk().
icu_collate_kk(col0)icu_collate_kk(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_kl().
icu_collate_kl(col0)icu_collate_kl(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_km().
icu_collate_km(col0)icu_collate_km(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_kn().
icu_collate_kn(col0)icu_collate_kn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ko().
icu_collate_ko(col0)icu_collate_ko(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_kok().
icu_collate_kok(col0)icu_collate_kok(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ku().
icu_collate_ku(col0)icu_collate_ku(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ky().
icu_collate_ky(col0)icu_collate_ky(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_lb().
icu_collate_lb(col0)icu_collate_lb(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_lij().
icu_collate_lij(col0)icu_collate_lij(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_lkt().
icu_collate_lkt(col0)icu_collate_lkt(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ln().
icu_collate_ln(col0)icu_collate_ln(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_lo().
icu_collate_lo(col0)icu_collate_lo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_lt().
icu_collate_lt(col0)icu_collate_lt(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_lv().
icu_collate_lv(col0)icu_collate_lv(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_mk().
icu_collate_mk(col0)icu_collate_mk(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ml().
icu_collate_ml(col0)icu_collate_ml(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_mn().
icu_collate_mn(col0)icu_collate_mn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_mr().
icu_collate_mr(col0)icu_collate_mr(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ms().
icu_collate_ms(col0)icu_collate_ms(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_mt().
icu_collate_mt(col0)icu_collate_mt(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_my().
icu_collate_my(col0)icu_collate_my(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_nb().
icu_collate_nb(col0)icu_collate_nb(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_nb_no().
icu_collate_nb_no(col0)icu_collate_nb_no(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ne().
icu_collate_ne(col0)icu_collate_ne(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_nl().
icu_collate_nl(col0)icu_collate_nl(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_nn().
icu_collate_nn(col0)icu_collate_nn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_noaccent().
icu_collate_noaccent(col0)icu_collate_noaccent(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_nso().
icu_collate_nso(col0)icu_collate_nso(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_om().
icu_collate_om(col0)icu_collate_om(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_or().
icu_collate_or(col0)icu_collate_or(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_pa().
icu_collate_pa(col0)icu_collate_pa(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_pa_in().
icu_collate_pa_in(col0)icu_collate_pa_in(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_pl().
icu_collate_pl(col0)icu_collate_pl(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ps().
icu_collate_ps(col0)icu_collate_ps(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_pt().
icu_collate_pt(col0)icu_collate_pt(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ro().
icu_collate_ro(col0)icu_collate_ro(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ru().
icu_collate_ru(col0)icu_collate_ru(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sa().
icu_collate_sa(col0)icu_collate_sa(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_se().
icu_collate_se(col0)icu_collate_se(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_si().
icu_collate_si(col0)icu_collate_si(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sk().
icu_collate_sk(col0)icu_collate_sk(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sl().
icu_collate_sl(col0)icu_collate_sl(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_smn().
icu_collate_smn(col0)icu_collate_smn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sq().
icu_collate_sq(col0)icu_collate_sq(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sr().
icu_collate_sr(col0)icu_collate_sr(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sr_ba().
icu_collate_sr_ba(col0)icu_collate_sr_ba(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sr_me().
icu_collate_sr_me(col0)icu_collate_sr_me(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sr_rs().
icu_collate_sr_rs(col0)icu_collate_sr_rs(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_st().
icu_collate_st(col0)icu_collate_st(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sv().
icu_collate_sv(col0)icu_collate_sv(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_sw().
icu_collate_sw(col0)icu_collate_sw(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ta().
icu_collate_ta(col0)icu_collate_ta(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_te().
icu_collate_te(col0)icu_collate_te(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_th().
icu_collate_th(col0)icu_collate_th(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_tk().
icu_collate_tk(col0)icu_collate_tk(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_tn().
icu_collate_tn(col0)icu_collate_tn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_to().
icu_collate_to(col0)icu_collate_to(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_tr().
icu_collate_tr(col0)icu_collate_tr(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ug().
icu_collate_ug(col0)icu_collate_ug(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_uk().
icu_collate_uk(col0)icu_collate_uk(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_ur().
icu_collate_ur(col0)icu_collate_ur(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_uz().
icu_collate_uz(col0)icu_collate_uz(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_vi().
icu_collate_vi(col0)icu_collate_vi(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_wae().
icu_collate_wae(col0)icu_collate_wae(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_wo().
icu_collate_wo(col0)icu_collate_wo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_xh().
icu_collate_xh(col0)icu_collate_xh(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_yi().
icu_collate_yi(col0)icu_collate_yi(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_yo().
icu_collate_yo(col0)icu_collate_yo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_yue().
icu_collate_yue(col0)icu_collate_yue(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_yue_cn().
icu_collate_yue_cn(col0)icu_collate_yue_cn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zh().
icu_collate_zh(col0)icu_collate_zh(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zh_cn().
icu_collate_zh_cn(col0)icu_collate_zh_cn(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zh_hk().
icu_collate_zh_hk(col0)icu_collate_zh_hk(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zh_mo().
icu_collate_zh_mo(col0)icu_collate_zh_mo(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zh_sg().
icu_collate_zh_sg(col0)icu_collate_zh_sg(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zh_tw().
icu_collate_zh_tw(col0)icu_collate_zh_tw(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_collate_zu().
icu_collate_zu(col0)icu_collate_zu(col0)
col0 |
|
VARCHAR
The icu extension (LOAD icu;).
DuckDB function icu_sort_key().
icu_sort_key(col0, col1)icu_sort_key(col0, col1)
col0, col1
|
|
VARCHAR
The icu extension (LOAD icu;).
Returns true if the string matches the like_specifier (see Pattern Matching) using case-insensitive matching. escape_character is used to search for wildcard characters in the string.
ilike_escape(string, like_specifier, escape_character)ilike_escape(string, like_specifier, escape_character)
string, like_specifier, escape_character
|
|
BOOLEAN
ilike_escape('A%c', 'a$%C', '$')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function import_database().
import_database(col0)import_database(col0)
col0 |
|
Unspecified.
Returns whether or not the database/schema are in the search path.
in_search_path(database_name, schema_name)in_search_path(database_name, schema_name)
database_name, schema_name
|
|
BOOLEAN
in_search_path('memory', 'main')
DuckDB macro inet_client_addr().
inet_client_addr()inet_client_addr()
Unspecified.
DuckDB macro inet_client_port().
inet_client_port()inet_client_port()
Unspecified.
DuckDB macro inet_server_addr().
inet_server_addr()inet_server_addr()
Unspecified.
DuckDB macro inet_server_port().
inet_server_port()inet_server_port()
Unspecified.
Returns location of first occurrence of search_string in string, counting from 1. Returns 0 if no match found.
instr(string, search_string)instr(string, search_string)
string, search_string
|
|
BIGINT
instr('test test', 'es')
position('b' IN 'abc')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Whether or not the provided value is the histogram "other" bin (used for values not belonging to any provided bin).
is_histogram_other_bin(val)is_histogram_other_bin(val)
val |
|
BOOLEAN
is_histogram_other_bin(v)
Returns true if the floating point value is finite, false otherwise.
isfinite(x)isfinite(x)
x |
|
BOOLEAN
isfinite(5.5)
Returns true if the floating point value is infinite, false otherwise.
isinf(x)isinf(x)
x |
|
BOOLEAN
isinf('Infinity'::float)
Returns true if the floating point value is not a number, false otherwise.
isnan(x)isnan(x)
x |
|
BOOLEAN
isnan('NaN'::FLOAT)
Extract the isodow component from a date or timestamp.
isodow(ts)isodow(ts)
ts |
|
BIGINT
isodow(timestamp '2021-08-03 11:59:44.123456')
Extract the isoyear component from a date or timestamp.
isoyear(ts)isoyear(ts)
ts |
|
BIGINT
isoyear(timestamp '2021-08-03 11:59:44.123456')
The Jaccard similarity between two strings. Characters of different cases (e.g., a and A) are considered different. Returns a number between 0 and 1.
jaccard(s1, s2)jaccard(s1, s2)
s1, s2
|
|
DOUBLE
jaccard('duck', 'luck')
Other text_similarity:
damerau_levenshtein(),
hamming(),
jaro_similarity(),
jaro_winkler_similarity(),
levenshtein()
The Jaro similarity between two strings. Characters of different cases (e.g., a and A) are considered different. Returns a number between 0 and 1. For similarity < score_cutoff, 0 is returned instead. score_cutoff defaults to 0.
jaro_similarity(s1, s2, score_cutoff)jaro_similarity(s1, s2, score_cutoff)
s1 |
|
s2 |
|
score_cutoff |
|
DOUBLE
jaro_similarity(s1 = VARCHAR, s2 = VARCHAR)
jaro_similarity(s1 = VARCHAR, s2 = VARCHAR, score_cutoff = DOUBLE)
jaro_similarity('duck', 'duckdb')
Other text_similarity:
damerau_levenshtein(),
hamming(),
jaccard(),
jaro_winkler_similarity(),
levenshtein()
The Jaro-Winkler similarity between two strings. Characters of different cases (e.g., a and A) are considered different. Returns a number between 0 and 1. For similarity < score_cutoff, 0 is returned instead. score_cutoff defaults to 0.
jaro_winkler_similarity(s1, s2, score_cutoff)jaro_winkler_similarity(s1, s2, score_cutoff)
s1 |
|
s2 |
|
score_cutoff |
|
DOUBLE
jaro_winkler_similarity(s1 = VARCHAR, s2 = VARCHAR)
jaro_winkler_similarity(s1 = VARCHAR, s2 = VARCHAR, score_cutoff = DOUBLE)
jaro_winkler_similarity('duck', 'duckdb')
Other text_similarity:
damerau_levenshtein(),
hamming(),
jaccard(),
jaro_similarity(),
levenshtein()
DuckDB macro json().
json(x)json(x)
x |
Unspecified. |
Unspecified.
The json extension (LOAD json;).
DuckDB function json_array().
json_array()json_array()
JSON
The json extension (LOAD json;).
DuckDB function json_array_length().
json_array_length(col0, col1)json_array_length(col0, col1)
col0 |
|
col1 |
|
UBIGINT | UBIGINT[]
json_array_length(col0 = VARCHAR)
json_array_length(col0 = VARCHAR, col1 = VARCHAR)
json_array_length(col0 = VARCHAR, col1 = `VARCHAR[]`)
json_array_length(col0 = JSON)
json_array_length(col0 = JSON, col1 = VARCHAR)
json_array_length(col0 = JSON, col1 = `VARCHAR[]`)
The json extension (LOAD json;).
DuckDB function json_contains().
json_contains(col0, col1)json_contains(col0, col1)
col0, col1
|
|
BOOLEAN
The json extension (LOAD json;).
DuckDB function json_deserialize_sql().
json_deserialize_sql(col0)json_deserialize_sql(col0)
col0 |
|
VARCHAR
The json extension (LOAD json;).
DuckDB function json_each().
json_each(col0, col1)json_each(col0, col1)
col0 |
|
col1 |
|
Unspecified.
json_each(col0 = VARCHAR)
json_each(col0 = VARCHAR, col1 = VARCHAR)
json_each(col0 = JSON)
json_each(col0 = JSON, col1 = VARCHAR)
The json extension (LOAD json;).
DuckDB function json_execute_serialized_sql().
json_execute_serialized_sql(col0)json_execute_serialized_sql(col0)
col0 |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function json_exists().
json_exists(col0, col1)json_exists(col0, col1)
col0 |
|
col1 |
|
BOOLEAN | BOOLEAN[]
The json extension (LOAD json;).
DuckDB function json_extract().
json_extract(col0, col1)json_extract(col0, col1)
col0 |
|
col1 |
|
JSON | JSON[]
The json extension (LOAD json;).
DuckDB function json_extract_path().
json_extract_path(col0, col1)json_extract_path(col0, col1)
col0 |
|
col1 |
|
JSON | JSON[]
The json extension (LOAD json;).
DuckDB function json_extract_path_text().
json_extract_path_text(col0, col1)json_extract_path_text(col0, col1)
col0 |
|
col1 |
|
VARCHAR | VARCHAR[]
The json extension (LOAD json;).
DuckDB function json_extract_string().
json_extract_string(col0, col1)json_extract_string(col0, col1)
col0 |
|
col1 |
|
VARCHAR | VARCHAR[]
The json extension (LOAD json;).
DuckDB macro json_group_array().
json_group_array(x)json_group_array(x)
x |
Unspecified. |
Unspecified.
The json extension (LOAD json;).
DuckDB macro json_group_object().
json_group_object(n, v)json_group_object(n, v)
n, v
|
Unspecified. |
Unspecified.
The json extension (LOAD json;).
DuckDB macro json_group_structure().
json_group_structure(x)json_group_structure(x)
x |
Unspecified. |
Unspecified.
The json extension (LOAD json;).
DuckDB function json_keys().
json_keys(col0, col1)json_keys(col0, col1)
col0 |
|
col1 |
|
VARCHAR[] | VARCHAR[][]
json_keys(col0 = VARCHAR)
json_keys(col0 = VARCHAR, col1 = VARCHAR)
json_keys(col0 = VARCHAR, col1 = `VARCHAR[]`)
json_keys(col0 = JSON)
json_keys(col0 = JSON, col1 = VARCHAR)
json_keys(col0 = JSON, col1 = `VARCHAR[]`)
The json extension (LOAD json;).
DuckDB function json_merge_patch().
json_merge_patch(col0, col1)json_merge_patch(col0, col1)
col0, col1
|
|
JSON
The json extension (LOAD json;).
DuckDB function json_object().
json_object()json_object()
JSON
The json extension (LOAD json;).
DuckDB function json_pretty().
json_pretty(col0)json_pretty(col0)
col0 |
|
VARCHAR
The json extension (LOAD json;).
DuckDB function json_quote().
json_quote()json_quote()
JSON
The json extension (LOAD json;).
DuckDB function json_serialize_plan().
json_serialize_plan(col0, col1, col2, col3, col4)json_serialize_plan(col0, col1, col2, col3, col4)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
JSON
json_serialize_plan(col0 = VARCHAR)
json_serialize_plan(col0 = VARCHAR, col1 = BOOLEAN)
json_serialize_plan(col0 = VARCHAR, col1 = BOOLEAN, col2 = BOOLEAN)
json_serialize_plan(col0 = VARCHAR, col1 = BOOLEAN, col2 = BOOLEAN, col3 = BOOLEAN)
json_serialize_plan(col0 = VARCHAR, col1 = BOOLEAN, col2 = BOOLEAN, col3 = BOOLEAN, col4 = BOOLEAN)
The json extension (LOAD json;).
DuckDB function json_serialize_sql().
json_serialize_sql(col0, col1, col2, col3, col4)json_serialize_sql(col0, col1, col2, col3, col4)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
JSON
json_serialize_sql(col0 = VARCHAR)
json_serialize_sql(col0 = VARCHAR, col1 = BOOLEAN)
json_serialize_sql(col0 = VARCHAR, col1 = BOOLEAN, col2 = BOOLEAN)
json_serialize_sql(col0 = VARCHAR, col1 = BOOLEAN, col2 = BOOLEAN, col3 = BOOLEAN)
json_serialize_sql(col0 = VARCHAR, col1 = BOOLEAN, col2 = BOOLEAN, col3 = BOOLEAN, col4 = BOOLEAN)
The json extension (LOAD json;).
DuckDB function json_structure().
json_structure(col0)json_structure(col0)
col0 |
|
JSON
The json extension (LOAD json;).
DuckDB function json_transform().
json_transform(col0, col1)json_transform(col0, col1)
col0 |
|
col1 |
|
ANY
The json extension (LOAD json;).
DuckDB function json_transform_strict().
json_transform_strict(col0, col1)json_transform_strict(col0, col1)
col0 |
|
col1 |
|
ANY
The json extension (LOAD json;).
DuckDB function json_tree().
json_tree(col0, col1)json_tree(col0, col1)
col0 |
|
col1 |
|
Unspecified.
json_tree(col0 = VARCHAR)
json_tree(col0 = VARCHAR, col1 = VARCHAR)
json_tree(col0 = JSON)
json_tree(col0 = JSON, col1 = VARCHAR)
The json extension (LOAD json;).
DuckDB function json_type().
json_type(col0, col1)json_type(col0, col1)
col0 |
|
col1 |
|
VARCHAR | VARCHAR[]
json_type(col0 = VARCHAR)
json_type(col0 = VARCHAR, col1 = VARCHAR)
json_type(col0 = VARCHAR, col1 = `VARCHAR[]`)
json_type(col0 = JSON)
json_type(col0 = JSON, col1 = VARCHAR)
json_type(col0 = JSON, col1 = `VARCHAR[]`)
The json extension (LOAD json;).
DuckDB function json_valid().
json_valid(col0)json_valid(col0)
col0 |
|
BOOLEAN
The json extension (LOAD json;).
DuckDB function json_value().
json_value(col0, col1)json_value(col0, col1)
col0 |
|
col1 |
|
VARCHAR | VARCHAR[]
The json extension (LOAD json;).
Extract the Julian Day number from a date or timestamp.
julian(ts)julian(ts)
ts |
|
DOUBLE
julian(timestamp '2006-01-01 12:00')
Calculates the sum using a more accurate floating point summation (Kahan Sum).
kahan_sum(arg)kahan_sum(arg)
arg |
|
DOUBLE
kahan_sum(A)
Returns the excess kurtosis (Fisher’s definition) of all input values, with a bias correction according to the sample size.
kurtosis(x)kurtosis(x)
x |
|
DOUBLE
Returns the excess kurtosis (Fisher’s definition) of all input values, without bias correction.
kurtosis_pop(x)kurtosis_pop(x)
x |
|
DOUBLE
DuckDB function lag().
lag(col0, col1, col2)lag(col0, col1, col2)
col0 |
|
col1 |
|
col2 |
|
T
DuckDB function lance_fts().
lance_fts(col0, col1, col2, filter, prefilter, k)lance_fts(col0, col1, col2, filter, prefilter, k)
col0 |
|
col1 |
|
col2 |
|
filter |
|
prefilter |
|
k |
|
Unspecified.
The lance extension (LOAD lance;).
DuckDB function lance_hybrid_search().
lance_hybrid_search( col0, col1, col2, col3, col4, alpha, use_index, prefilter, refine_factor, nprobs, oversample_factor, k )lance_hybrid_search( col0, col1, col2, col3, col4, alpha, use_index, prefilter, refine_factor, nprobs, oversample_factor, k )
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
alpha |
|
use_index |
|
prefilter |
|
refine_factor |
|
nprobs |
|
oversample_factor |
|
k |
|
Unspecified.
The lance extension (LOAD lance;).
DuckDB function lance_vector_search().
lance_vector_search( col0, col1, col2, filter, explain_verbose, use_index, prefilter, refine_factor, nprobs, k )lance_vector_search( col0, col1, col2, filter, explain_verbose, use_index, prefilter, refine_factor, nprobs, k )
col0 |
|
col1 |
|
col2 |
|
filter |
|
explain_verbose |
|
use_index |
|
prefilter |
|
refine_factor |
|
nprobs |
|
k |
|
Unspecified.
The lance extension (LOAD lance;).
Returns the last value of a column. This function is affected by ordering.
last(arg)last(arg)
arg |
|
DECIMAL | ANY | T
last(arg = DECIMAL)
last(arg = ANY)
last(col0 = T)
last(A)
Returns the last day of the month.
last_day(ts)last_day(ts)
ts |
|
DATE
last_day(TIMESTAMP '1992-03-22 01:02:03.1234')
DuckDB function last_value().
last_value(col0)last_value(col0)
col0 |
|
T
DuckDB function lead().
lead(col0, col1, col2)lead(col0, col1, col2)
col0 |
|
col1 |
|
col2 |
|
T
Returns the smallest value. For strings lexicographical ordering is used. Note that uppercase characters are considered “smaller” than lowercase characters, and collations are not supported.
least(arg1)least(arg1)
arg1 |
|
ANY
least(42, 84)
least('abc', 'bcd', 'cde', 'EFG')
Other aggregate:
greatest()
Other date:
greatest()
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hex(),
len(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Other timestamp:
greatest()
Computes the least common multiple of x and y.
least_common_multiple(x, y)least_common_multiple(x, y)
x, y
|
|
BIGINT | HUGEINT
least_common_multiple(42, 57)
Extracts the left-most count characters.
left(string, count)left(string, count)
string |
|
count |
|
VARCHAR
left('Hello🦆', 2)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Extracts the left-most count grapheme clusters.
left_grapheme(string, count)left_grapheme(string, count)
string |
|
count |
|
VARCHAR
left_grapheme('🤦🏼♂️🤦🏽♀️', 1)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
len(string = VARCHAR): Number of characters in string.
len(bit = BIT): Returns the bit-length of the bit argument.
len(list = `ANY[]`): Returns the length of the list.
len(string)len(string)
string |
|
BIGINT
len(string = VARCHAR)
len(bit = BIT)
len(list = `ANY[]`)
length('Hello🦆')
length(42::TINYINT::BIT)
length([1,2,3])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hex(),
least(),
parse_formatted_bytes(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Number of grapheme clusters in string.
length_grapheme(string)length_grapheme(string)
string |
|
BIGINT
length_grapheme('🤦🏼♂️🤦🏽♀️')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
The minimum number of single-character edits (insertions, deletions or substitutions) required to change one string to the other. Characters of different cases (e.g., a and A) are considered different.
levenshtein(s1, s2)levenshtein(s1, s2)
s1, s2
|
|
BIGINT
levenshtein('duck', 'db')
Other text_similarity:
damerau_levenshtein(),
hamming(),
jaccard(),
jaro_similarity(),
jaro_winkler_similarity()
Computes the log of the gamma function.
lgamma(x)lgamma(x)
x |
|
DOUBLE
lgamma(2)
Returns true if the string matches the like_specifier (see Pattern Matching) using case-sensitive matching. escape_character is used to search for wildcard characters in the string.
like_escape(string, like_specifier, escape_character)like_escape(string, like_specifier, escape_character)
string, like_specifier, escape_character
|
|
BOOLEAN
like_escape('a%c', 'a$%c', '$')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Executes the aggregate function function_name on the elements of list.
list_aggregate(list, function_name)list_aggregate(list, function_name)
list |
|
function_name |
|
ANY
list_aggregate([1, 2, NULL], 'min')
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_any_value().
list_any_value(l)list_any_value(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_append().
list_append(l, e)list_append(l, e)
l, e
|
Unspecified. |
Unspecified.
DuckDB macro list_approx_count_distinct().
list_approx_count_distinct(l)list_approx_count_distinct(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_avg().
list_avg(l)list_avg(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_bit_and().
list_bit_and(l)list_bit_and(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_bit_or().
list_bit_or(l)list_bit_or(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_bit_xor().
list_bit_xor(l)list_bit_xor(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_bool_and().
list_bool_and(l)list_bool_and(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_bool_or().
list_bool_or(l)list_bool_or(l)
l |
Unspecified. |
Unspecified.
Concatenates lists. NULL inputs are skipped. See also operator ||.
list_concat()list_concat()
ANY[]
list_concat([2, 3], [4, 5, 6], [7])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Returns true if the list contains the element.
list_contains(list, element)list_contains(list, element)
list |
|
element |
|
BOOLEAN
list_contains([1, 2, NULL], 1)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Computes the cosine distance between two same-sized lists.
list_cosine_distance(list1, list2)list_cosine_distance(list1, list2)
list1, list2
|
|
FLOAT | DOUBLE
list_cosine_distance([1, 2, 3], [1, 2, 3])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Computes the cosine similarity between two same-sized lists.
list_cosine_similarity(list1, list2)list_cosine_similarity(list1, list2)
list1, list2
|
|
FLOAT | DOUBLE
list_cosine_similarity([1, 2, 3], [1, 2, 3])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_count().
list_count(l)list_count(l)
l |
Unspecified. |
Unspecified.
Calculates the Euclidean distance between two points with coordinates given in two inputs lists of equal length.
list_distance(list1, list2)list_distance(list1, list2)
list1, list2
|
|
FLOAT | DOUBLE
list_distance([1, 2, 3], [1, 2, 5])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Removes all duplicates and NULL values from a list. Does not preserve the original order.
list_distinct(list)list_distinct(list)
list |
|
T[]
list_distinct([1, 1, NULL, -3, 1, 5])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_entropy().
list_entropy(l)list_entropy(l)
l |
Unspecified. |
Unspecified.
Extract the indexth (1-based) value from the list.
list_extract(list, index)list_extract(list, index)
list |
|
index |
|
T | VARCHAR
list_extract([4, 5, 6], 3)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Constructs a list from those elements of the input list for which the lambda function returns true. DuckDB must be able to cast the lambda function's return type to BOOL. The return type of list_filter is the same as the input list's.
list_filter(list, lambda)list_filter(list, lambda)
list |
|
lambda |
|
ANY[]
list_filter([3, 4, 5], lambda x : x > 4)
Other lambda:
list_reduce(),
list_transform()
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_first().
list_first(l)list_first(l)
l |
Unspecified. |
Unspecified.
Works like list_sort, but the results are the indexes that correspond to the position in the original list instead of the actual values.
list_grade_up(list, col1, col2)list_grade_up(list, col1, col2)
list |
|
col1 |
|
col2 |
|
ANY[]
list_grade_up(list = `ANY[]`)
list_grade_up(list = `ANY[]`, col1 = VARCHAR)
list_grade_up(list = `ANY[]`, col1 = VARCHAR, col2 = VARCHAR)
list_grade_up([3, 6, 1, 2])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Returns true if all elements of list2 are in list1. NULLs are ignored.
list_has_all(list1, list2)list_has_all(list1, list2)
list1, list2
|
|
BOOLEAN
list_has_all([1, 2, 3], [2, 3])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Returns true if the lists have any element in common. NULLs are ignored.
list_has_any(list1, list2)list_has_any(list1, list2)
list1, list2
|
|
BOOLEAN
list_has_any([1, 2, 3], [2, 3, 4])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_histogram().
list_histogram(l)list_histogram(l)
l |
Unspecified. |
Unspecified.
Computes the inner product between two same-sized lists.
list_inner_product(list1, list2)list_inner_product(list1, list2)
list1, list2
|
|
FLOAT | DOUBLE
list_inner_product([1, 2, 3], [1, 2, 3])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Returns a list containing the distinct elements that are present in both list1 and list2.
list_intersect(list1, list2)list_intersect(list1, list2)
list1, list2
|
|
T[]
list_intersect([1, 2, 3], [2, 3, 4])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_kurtosis().
list_kurtosis(l)list_kurtosis(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_kurtosis_pop().
list_kurtosis_pop(l)list_kurtosis_pop(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_last().
list_last(l)list_last(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_mad().
list_mad(l)list_mad(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_max().
list_max(l)list_max(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_median().
list_median(l)list_median(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_min().
list_min(l)list_min(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_mode().
list_mode(l)list_mode(l)
l |
Unspecified. |
Unspecified.
Computes the negative inner product between two same-sized lists.
list_negative_inner_product(list1, list2)list_negative_inner_product(list1, list2)
list1, list2
|
|
FLOAT | DOUBLE
list_negative_inner_product([1, 2, 3], [1, 2, 3])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Returns the index of the element if the list contains the element. If the element is not found, it returns NULL.
list_position(list, element)list_position(list, element)
list |
|
element |
|
INTEGER
list_position([1, 2, NULL], 2)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_prepend().
list_prepend(e, l)list_prepend(e, l)
e, l
|
Unspecified. |
Unspecified.
DuckDB macro list_product().
list_product(l)list_product(l)
l |
Unspecified. |
Unspecified.
Reduces all elements of the input list into a single scalar value by executing the lambda function on a running result and the next list element. The lambda function has an optional initial_value argument.
list_reduce(list, lambda, initial_value)list_reduce(list, lambda, initial_value)
list |
|
lambda |
|
initial_value |
|
ANY
list_reduce(list = `ANY[]`, lambda = LAMBDA)
list_reduce(list = `ANY[]`, lambda = LAMBDA, initial_value = ANY)
list_reduce([1, 2, 3], lambda x, y : x + y)
Other lambda:
list_filter(),
list_transform()
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Resizes the list to contain size elements. Initializes new elements with value or NULL if value is not set.
list_resize(list, size, value)list_resize(list, size, value)
list |
|
size |
|
value |
|
ANY[]
list_resize(list = `ANY[]`, size = ANY)
list_resize(list = `ANY[]`, size = ANY, value = ANY)
list_resize([1, 2, 3], 5, 0)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_reverse().
list_reverse(l)list_reverse(l)
l |
Unspecified. |
Unspecified.
Sorts the elements of the list in reverse order.
list_reverse_sort(list, col1)list_reverse_sort(list, col1)
list |
|
col1 |
|
ANY[]
list_reverse_sort(list = `ANY[]`)
list_reverse_sort(list = `ANY[]`, col1 = VARCHAR)
list_reverse_sort([3, 6, 1, 2])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Returns a list based on the elements selected by the index_list.
list_select(value_list, index_list)list_select(value_list, index_list)
value_list |
|
index_list |
|
T[]
list_select([10, 20, 30, 40], [1, 4])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_sem().
list_sem(l)list_sem(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_skewness().
list_skewness(l)list_skewness(l)
l |
Unspecified. |
Unspecified.
list_slice(list = ANY, begin = ANY, end = ANY): Extracts a sublist or substring using slice conventions. Negative values are accepted.
list_slice(list = ANY, begin = ANY, end = ANY, step = BIGINT): list_slice with added step feature.
list_slice(list, begin, end, step)list_slice(list, begin, end, step)
list |
|
begin |
|
end |
|
step |
|
ANY
list_slice(list = ANY, begin = ANY, end = ANY)
list_slice(list = ANY, begin = ANY, end = ANY, step = BIGINT)
list_slice([4, 5, 6], 2, 3)
list_slice([4, 5, 6], 1, 3, 2)
array_slice('DuckDB', 3, 4)
array_slice('DuckDB', 3, NULL)
array_slice('DuckDB', 0, -3)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Sorts the elements of the list.
list_sort(list, col1, col2)list_sort(list, col1, col2)
list |
|
col1 |
|
col2 |
|
ANY[]
list_sort(list = `ANY[]`)
list_sort(list = `ANY[]`, col1 = VARCHAR)
list_sort(list = `ANY[]`, col1 = VARCHAR, col2 = VARCHAR)
list_sort([3, 6, 1, 2])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_stddev_pop().
list_stddev_pop(l)list_stddev_pop(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_stddev_samp().
list_stddev_samp(l)list_stddev_samp(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_string_agg().
list_string_agg(l)list_string_agg(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_sum().
list_sum(l)list_sum(l)
l |
Unspecified. |
Unspecified.
Returns a list that is the result of applying the lambda function to each element of the input list. The return type is defined by the return type of the lambda function.
list_transform(list, lambda)list_transform(list, lambda)
list |
|
lambda |
|
ANY[]
list_transform([1, 2, 3], lambda x : x + 1)
Other lambda:
list_filter(),
list_reduce()
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Counts the unique elements of a list.
list_unique(list)list_unique(list)
list |
|
UBIGINT
list_unique([1, 1, NULL, -3, 1, 5])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Creates a LIST containing the argument values.
list_value(any)list_value(any)
any |
|
"NULL"[] | T[]
list_value()
list_value(any = T)
list_value(4, 5, 6)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_where(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
DuckDB macro list_var_pop().
list_var_pop(l)list_var_pop(l)
l |
Unspecified. |
Unspecified.
DuckDB macro list_var_samp().
list_var_samp(l)list_var_samp(l)
l |
Unspecified. |
Unspecified.
Returns a list with the BOOLEANs in mask_list applied as a mask to the value_list.
list_where(value_list, mask_list)list_where(value_list, mask_list)
value_list |
|
mask_list |
|
T[]
list_where([10, 20, 30, 40], [true, false, false, true])
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_zip(),
or–or,
range(),
repeat(),
unpivot_list()
Zips n LISTs to a new LIST whose length will be that of the longest list. Its elements are structs of n elements from each list list_1, …, list_n, missing elements are replaced with NULL. If truncate is set, all lists are truncated to the smallest list length.
list_zip()list_zip()
STRUCT[]
list_zip([1, 2], [3, 4], [5, 6]) list_zip([1, 2], [3, 4], [5, 6, 7]) list_zip([1, 2], [3, 4], [5, 6, 7], true)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
or–or,
range(),
repeat(),
unpivot_list()
Computes the natural logarithm of x.
ln(x)ln(x)
x |
|
DOUBLE
ln(2)
DuckDB function load_aws_credentials().
load_aws_credentials(col0, redact_secret, set_region)load_aws_credentials(col0, redact_secret, set_region)
col0 |
|
redact_secret |
|
set_region |
|
Unspecified.
load_aws_credentials(redact_secret = BOOLEAN, set_region = BOOLEAN)
load_aws_credentials(col0 = VARCHAR, redact_secret = BOOLEAN, set_region = BOOLEAN)
The aws extension (LOAD aws;).
Computes the logarithm of x to base b. b may be omitted, in which case the default 10.
log(b, x)log(b, x)
b, x
|
|
DOUBLE
log(b = DOUBLE)
log(b = DOUBLE, x = DOUBLE)
log(2, 64)
Computes the 10-log of x.
log10(x)log10(x)
x |
|
DOUBLE
log10(1000)
Computes the 2-log of x.
log2(x)log2(x)
x |
|
DOUBLE
log2(8)
Converts string to lower case.
lower(string)lower(string)
string |
|
VARCHAR
lower('Hello')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Pads the string with the character on the left until it has count characters. Truncates the string on the right if it has more than count characters.
lpad(string, count, character)lpad(string, count, character)
string |
|
count |
|
character |
|
VARCHAR
lpad('hello', 8, '>')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Removes any occurrences of any of the characters from the left side of the string. characters defaults to space.
ltrim(string, characters)ltrim(string, characters)
string, characters
|
|
VARCHAR
ltrim(string = VARCHAR)
ltrim(string = VARCHAR, characters = VARCHAR)
ltrim(' test ')
ltrim('>>>>test<<', '><')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns the median absolute deviation for the values within x. NULL values are ignored. Temporal types return a positive INTERVAL. .
mad(x)mad(x)
x |
|
DECIMAL | FLOAT | DOUBLE | INTERVAL
mad(x)
make_date(year = BIGINT, month = BIGINT, day = BIGINT): The date for the given parts.
make_date(date.struct = `STRUCT("year" BIGINT, "month" BIGINT, "day" BIGINT)`): The date for the given struct.
make_date(col0 = INTEGER): (Description missing.)
make_date(year, month, day)make_date(year, month, day)
year, month, day
|
|
DATE
make_date(col0 = INTEGER)
make_date(year = BIGINT, month = BIGINT, day = BIGINT)
make_date(date.struct = `STRUCT("year" BIGINT, "month" BIGINT, "day" BIGINT)`)
make_date(1992, 9, 20)
make_date({'year': 2024, 'month': 11, 'day': 14})
The time for the given parts.
make_time(hour, minute, seconds)make_time(hour, minute, seconds)
hour |
|
minute |
|
seconds |
|
TIME
make_time(13, 34, 27.123456)
The timestamp for the given parts.
make_timestamp(year, month, day, hour, minute, seconds)make_timestamp(year, month, day, hour, minute, seconds)
year |
|
month |
|
day |
|
hour |
|
minute |
|
seconds |
|
TIMESTAMP
make_timestamp(year = BIGINT, month = BIGINT, day = BIGINT, hour = BIGINT, minute = BIGINT, seconds = DOUBLE)
make_timestamp(year = BIGINT)
make_timestamp(1992, 9, 20, 13, 34, 27.123456)
The timestamp for the given microseconds since the epoch.
make_timestamp_ms(nanos)make_timestamp_ms(nanos)
nanos |
|
TIMESTAMP
make_timestamp_ms(1732117793000000)
The timestamp for the given nanoseconds since epoch.
make_timestamp_ns(nanos)make_timestamp_ns(nanos)
nanos |
|
TIMESTAMP_NS
make_timestamp_ns(1732117793000000000)
DuckDB function make_timestamptz().
make_timestamptz(col0, col1, col2, col3, col4, col5, col6)make_timestamptz(col0, col1, col2, col3, col4, col5, col6)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
col5 |
|
col6 |
|
TIMESTAMP WITH TIME ZONE
make_timestamptz(col0 = BIGINT, col1 = BIGINT, col2 = BIGINT, col3 = BIGINT, col4 = BIGINT, col5 = DOUBLE)
make_timestamptz(col0 = BIGINT, col1 = BIGINT, col2 = BIGINT, col3 = BIGINT, col4 = BIGINT, col5 = DOUBLE, col6 = VARCHAR)
make_timestamptz(col0 = BIGINT)
The icu extension (LOAD icu;).
Construct a type from its name and optional parameters.
make_type(name)make_type(name)
name |
|
TYPE
make_type('DECIMAL', 10, 2)
Creates a map from a set of keys and values.
map(keys, values)map(keys, values)
keys |
|
values |
|
MAP("NULL", "NULL") | MAP(K, V)
map()
map(keys = `K[]`, values = `V[]`)
map(['key1', 'key2'], ['val1', 'val2'])
Returns a map created from merging the input maps, on key collision the value is taken from the last map with that key.
map_concat()map_concat()
LIST
map_concat(map([1, 2], ['a', 'b']), map([2, 3], ['c', 'd']));
Checks if a map contains a given key.
map_contains(map, key)map_contains(map, key)
map |
|
key |
|
BOOLEAN
map_contains(MAP {'key1': 10, 'key2': 20, 'key3': 30}, 'key2')
DuckDB macro map_contains_entry().
map_contains_entry(map, key, value)map_contains_entry(map, key, value)
map, key, value
|
Unspecified. |
Unspecified.
DuckDB macro map_contains_value().
map_contains_value(map, value)map_contains_value(map, value)
map, value
|
Unspecified. |
Unspecified.
Returns the map entries as a list of keys/values.
map_entries(map)map_entries(map)
map |
|
STRUCT("key" K, "value" V)[]
map_entries(map(['key'], ['val']))
Returns a list containing the value for a given key or an empty list if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map’s keys else an error is returned.
map_extract(map, key)map_extract(map, key)
map |
|
key |
|
V[]
map_extract(map(['key'], ['val']), 'key')
Returns the value for a given key or NULL if the key is not contained in the map. The type of the key provided in the second parameter must match the type of the map’s keys else an error is returned.
map_extract_value(map, key)map_extract_value(map, key)
map |
|
key |
|
V
map_extract_value(map(['key'], ['val']), 'key')
Returns a map created from the entries of the array.
map_from_entries(map)map_from_entries(map)
map |
|
MAP(K, V)
map_from_entries([{k: 5, v: 'val1'}, {k: 3, v: 'val2'}]);
Returns the keys of a map as a list.
map_keys(map)map_keys(map)
map |
|
K[]
map_keys(map(['key'], ['val']))
DuckDB macro map_to_pg_oid().
map_to_pg_oid(type_name)map_to_pg_oid(type_name)
type_name |
Unspecified. |
Unspecified.
Returns the values of a map as a list.
map_values(map)map_values(map)
map |
|
V[]
map_values(map(['key'], ['val']))
Returns the maximum value present in arg.
max(arg, col1)max(arg, col1)
arg |
|
col1 |
|
ANY | ANY[]
max(arg = ANY)
max(arg = ANY, col1 = BIGINT)
max(A)
md5(string = VARCHAR): Returns the MD5 hash of the string as a VARCHAR.
md5(blob = BLOB): Returns the MD5 hash of the blob as a VARCHAR.
md5(string)md5(string)
string |
|
VARCHAR
md5(string = VARCHAR)
md5(blob = BLOB)
md5('abc')
md5('\xAA\xBB'::BLOB)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
md5_number(string = VARCHAR): Returns the MD5 hash of the string as a HUGEINT.
md5_number(blob = BLOB): Returns the MD5 hash of the blob as a HUGEINT.
md5_number(string)md5_number(string)
string |
|
UHUGEINT
md5_number(string = VARCHAR)
md5_number(blob = BLOB)
md5_number('abc')
md5_number('\xAA\xBB'::BLOB)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB macro md5_number_lower().
md5_number_lower(param)md5_number_lower(param)
param |
Unspecified. |
Unspecified.
DuckDB macro md5_number_upper().
md5_number_upper(param)md5_number_upper(param)
param |
Unspecified. |
Unspecified.
Returns the middle value of the set. NULL values are ignored. For even value counts, interpolate-able types (numeric, date/time) return the average of the two middle values. Non-interpolate-able types (everything else) return the lower of the two middle values.
median(x)median(x)
x |
|
ANY
median(x)
DuckDB function metadata_info().
metadata_info()metadata_info()
Unspecified.
Extract the microsecond component from a date or timestamp.
microsecond(ts)microsecond(ts)
ts |
|
BIGINT
microsecond(timestamp '2021-08-03 11:59:44.123456')
Extract the millennium component from a date or timestamp.
millennium(ts)millennium(ts)
ts |
|
BIGINT
millennium(timestamp '2021-08-03 11:59:44.123456')
Extract the millisecond component from a date or timestamp.
millisecond(ts)millisecond(ts)
ts |
|
BIGINT
millisecond(timestamp '2021-08-03 11:59:44.123456')
Returns the minimum value present in arg.
min(arg, col1)min(arg, col1)
arg |
|
col1 |
|
ANY | ANY[]
min(arg = ANY)
min(arg = ANY, col1 = BIGINT)
min(A)
Extract the minute component from a date or timestamp.
minute(ts)minute(ts)
ts |
|
BIGINT
minute(timestamp '2021-08-03 11:59:44.123456')
DuckDB function mod().
mod(col0, col1)mod(col0, col1)
col0, col1
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT
Returns the most frequent value for the values within x. NULL values are ignored.
mode(x)mode(x)
x |
|
ANY
Extract the month component from a date or timestamp.
month(ts)month(ts)
ts |
|
BIGINT
month(timestamp '2021-08-03 11:59:44.123456')
The (English) name of the month.
monthname(ts)monthname(ts)
ts |
|
VARCHAR
monthname(TIMESTAMP '1992-09-20')
DuckDB function multiply().
multiply(col0, col1)multiply(col0, col1)
col0, col1
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | INTERVAL
DuckDB function murmur3_32().
murmur3_32(col0)murmur3_32(col0)
col0 |
|
INTEGER
The ducklake extension (LOAD ducklake;).
DuckDB function mysql_clear_cache().
mysql_clear_cache()mysql_clear_cache()
Unspecified.
The mysql_scanner extension (LOAD mysql_scanner;).
DuckDB function mysql_debug_execution_plan().
mysql_debug_execution_plan()mysql_debug_execution_plan()
Unspecified.
The mysql_scanner extension (LOAD mysql_scanner;).
DuckDB function mysql_execute().
mysql_execute(col0, col1, params)mysql_execute(col0, col1, params)
col0 |
|
col1 |
|
params |
|
Unspecified.
The mysql_scanner extension (LOAD mysql_scanner;).
DuckDB function mysql_explain_federated().
mysql_explain_federated()mysql_explain_federated()
Unspecified.
The mysql_scanner extension (LOAD mysql_scanner;).
DuckDB function mysql_query().
mysql_query(col0, col1, stream_results, params)mysql_query(col0, col1, stream_results, params)
col0 |
|
col1 |
|
stream_results |
|
params |
|
Unspecified.
The mysql_scanner extension (LOAD mysql_scanner;).
Extract the nanosecond component from a date or timestamp.
nanosecond(tsns)nanosecond(tsns)
tsns |
|
BIGINT
nanosecond(timestamp_ns '2021-08-03 11:59:44.123456789')
DuckDB function netmask().
netmask(col0)netmask(col0)
col0 |
|
INET
The inet extension (LOAD inet;).
DuckDB function network().
network(col0)network(col0)
col0 |
|
INET
The inet extension (LOAD inet;).
Returns the next floating point value after x in the direction of y.
nextafter(x, y)nextafter(x, y)
x, y
|
|
DOUBLE | FLOAT
nextafter(1::float, 2::float)
Return the following value of the sequence.
nextval(sequence_name)nextval(sequence_name)
sequence_name |
|
BIGINT
nextval('my_sequence_name')
Converts string to Unicode NFC normalized string. Useful for comparisons and ordering if text data is mixed between NFC normalized and not.
nfc_normalize(string)nfc_normalize(string)
string |
|
VARCHAR
nfc_normalize('ardèch')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Normalizes an INTERVAL to an equivalent interval.
normalized_interval(interval)normalized_interval(interval)
interval |
|
INTERVAL
normalized_interval(INTERVAL '30 days')
Returns false if the string matches the like_specifier (see Pattern Matching) using case-insensitive matching. escape_character is used to search for wildcard characters in the string.
not_ilike_escape(string, like_specifier, escape_character)not_ilike_escape(string, like_specifier, escape_character)
string, like_specifier, escape_character
|
|
BOOLEAN
not_ilike_escape('A%c', 'a$%C', '$')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns false if the string matches the like_specifier (see Pattern Matching) using case-sensitive matching. escape_character is used to search for wildcard characters in the string.
not_like_escape(string, like_specifier, escape_character)not_like_escape(string, like_specifier, escape_character)
string, like_specifier, escape_character
|
|
BOOLEAN
not_like_escape('a%c', 'a$%c', '$')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function !~~().
`!~~`(col0, col1)`!~~`(col0, col1)
col0, col1
|
|
BOOLEAN
DuckDB function !~~*().
`!~~*`(col0, col1)`!~~*`(col0, col1)
col0, col1
|
|
BOOLEAN
DuckDB function nth_value().
nth_value(col0, col1)nth_value(col0, col1)
col0 |
|
col1 |
|
T
DuckDB function ntile().
ntile(col0)ntile(col0)
col0 |
|
BIGINT
DuckDB macro nullif().
nullif(a, b)nullif(a, b)
a, b
|
Unspecified. |
Unspecified.
DuckDB macro obj_description().
obj_description(object_oid, catalog_name)obj_description(object_oid, catalog_name)
object_oid, catalog_name
|
Unspecified. |
Unspecified.
octet_length(blob = BLOB): Number of bytes in blob.
octet_length(bitstring = BIT): Returns the number of bytes in the bitstring.
octet_length(blob)octet_length(blob)
blob |
|
BIGINT
octet_length(blob = BLOB)
octet_length(bitstring = BIT)
octet_length('\xAA\xBB'::BLOB)
octet_length('1101011'::BITSTRING)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Bitwise OR.
`|`(left, right)`|`(left, right)
left, right
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
32 | 3
Concatenates two strings, lists, or blobs. Any NULL input results in NULL. See also concat(arg1, arg2, ...) and list_concat(list1, list2, ...).
`||`(arg1, arg2)`||`(arg1, arg2)
arg1, arg2
|
|
ANY
'Duck' || 'DB' [1, 2, 3] || [4, 5, 6] '\xAA'::BLOB || '\xBB'::BLOB
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
repeat(),
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
range(),
repeat(),
unpivot_list()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function parquet_bloom_probe().
parquet_bloom_probe(col0, col1, col2)parquet_bloom_probe(col0, col1, col2)
col0 |
|
col1 |
|
col2 |
|
Unspecified.
DuckDB function parquet_file_metadata().
parquet_file_metadata(col0)parquet_file_metadata(col0)
col0 |
|
Unspecified.
DuckDB function parquet_full_metadata().
parquet_full_metadata(col0)parquet_full_metadata(col0)
col0 |
|
Unspecified.
DuckDB function parquet_kv_metadata().
parquet_kv_metadata(col0)parquet_kv_metadata(col0)
col0 |
|
Unspecified.
DuckDB function parquet_metadata().
parquet_metadata(col0)parquet_metadata(col0)
col0 |
|
Unspecified.
DuckDB function parquet_scan().
parquet_scan( col0, can_have_nan, filename, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types, schema )parquet_scan( col0, can_have_nan, filename, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types, schema )
col0 |
|
can_have_nan |
|
filename |
|
union_by_name |
|
debug_use_openssl |
|
hive_partitioning |
|
parquet_version |
|
encryption_config |
|
hive_types_autocast |
|
binary_as_string |
|
explicit_cardinality |
|
compression |
|
file_row_number |
|
hive_types |
|
schema |
|
Unspecified.
DuckDB function parquet_schema().
parquet_schema(col0)parquet_schema(col0)
col0 |
|
Unspecified.
DuckDB macro parse_delta_filter_logline().
parse_delta_filter_logline(x)parse_delta_filter_logline(x)
x |
Unspecified. |
Unspecified.
The delta extension (LOAD delta;).
Returns the top-level directory name from the given path. separator options: system, both_slash (default), forward_slash, backslash.
parse_dirname(path, separator)parse_dirname(path, separator)
path, separator
|
|
VARCHAR
parse_dirname(path = VARCHAR)
parse_dirname(path = VARCHAR, separator = VARCHAR)
parse_dirname('path/to/file.csv', 'system')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns the head of the path (the pathname until the last slash) similarly to Python's os.path.dirname. separator options: system, both_slash (default), forward_slash, backslash.
parse_dirpath(path, separator)parse_dirpath(path, separator)
path, separator
|
|
VARCHAR
parse_dirpath(path = VARCHAR)
parse_dirpath(path = VARCHAR, separator = VARCHAR)
parse_dirpath('path/to/file.csv', 'forward_slash')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Parse the message into the expected logical type.
parse_duckdb_log_message(type, message)parse_duckdb_log_message(type, message)
type, message
|
|
ANY
parse_duckdb_log_message('FileSystem', log_message)
Returns the last component of the path similarly to Python's os.path.basename function. If trim_extension is true, the file extension will be removed (defaults to false). separator options: system, both_slash (default), forward_slash, backslash.
parse_filename(string, trim_extension)parse_filename(string, trim_extension)
string |
|
trim_extension |
|
VARCHAR
parse_filename(string = VARCHAR)
parse_filename(string = VARCHAR, trim_extension = VARCHAR)
parse_filename(string = VARCHAR, trim_extension = BOOLEAN)
parse_filename(string = VARCHAR, trim_extension = BOOLEAN, separator = VARCHAR)
parse_filename('path/to/file.csv', true, 'forward_slash')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Parses a human-readable representation of a size in bytes into an integer.
parse_formatted_bytes(string)parse_formatted_bytes(string)
string |
|
UBIGINT
parse_formatted_bytes('16 KiB')
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hex(),
least(),
len(),
to_base()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns a list of the components (directories and filename) in the path similarly to Python's pathlib.parts function. separator options: system, both_slash (default), forward_slash, backslash.
parse_path(path, separator)parse_path(path, separator)
path, separator
|
|
VARCHAR[]
parse_path(path = VARCHAR)
parse_path(path = VARCHAR, separator = VARCHAR)
parse_path('path/to/file.csv', 'system')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function percent_rank().
percent_rank()percent_rank()
DOUBLE
DuckDB function pg_clear_cache().
pg_clear_cache()pg_clear_cache()
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB macro pg_collation_is_visible().
pg_collation_is_visible(collation_oid)pg_collation_is_visible(collation_oid)
collation_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_conf_load_time().
pg_conf_load_time()pg_conf_load_time()
Unspecified.
DuckDB macro pg_conversion_is_visible().
pg_conversion_is_visible(conversion_oid)pg_conversion_is_visible(conversion_oid)
conversion_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_function_is_visible().
pg_function_is_visible(function_oid)pg_function_is_visible(function_oid)
function_oid |
Unspecified. |
Unspecified.
DuckDB function pg_get_constraintdef().
pg_get_constraintdef(constraint_oid, pretty_bool)pg_get_constraintdef(constraint_oid, pretty_bool)
constraint_oid, pretty_bool
|
Unspecified. |
Unspecified.
pg_get_constraintdef(constraint_oid)
pg_get_constraintdef(constraint_oid, pretty_bool)
DuckDB macro pg_get_expr().
pg_get_expr(pg_node_tree, relation_oid)pg_get_expr(pg_node_tree, relation_oid)
pg_node_tree, relation_oid
|
Unspecified. |
Unspecified.
DuckDB macro pg_get_viewdef().
pg_get_viewdef(oid)pg_get_viewdef(oid)
oid |
Unspecified. |
Unspecified.
DuckDB function pg_has_role().
pg_has_role(user, role, privilege)pg_has_role(user, role, privilege)
user, role, privilege
|
Unspecified. |
Unspecified.
pg_has_role(user, role, privilege)
pg_has_role(role, privilege)
DuckDB macro pg_is_other_temp_schema().
pg_is_other_temp_schema(schema_id)pg_is_other_temp_schema(schema_id)
schema_id |
Unspecified. |
Unspecified.
DuckDB macro pg_my_temp_schema().
pg_my_temp_schema()pg_my_temp_schema()
Unspecified.
DuckDB macro pg_opclass_is_visible().
pg_opclass_is_visible(opclass_oid)pg_opclass_is_visible(opclass_oid)
opclass_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_operator_is_visible().
pg_operator_is_visible(operator_oid)pg_operator_is_visible(operator_oid)
operator_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_opfamily_is_visible().
pg_opfamily_is_visible(opclass_oid)pg_opfamily_is_visible(opclass_oid)
opclass_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_postmaster_start_time().
pg_postmaster_start_time()pg_postmaster_start_time()
Unspecified.
DuckDB macro pg_size_pretty().
pg_size_pretty(bytes)pg_size_pretty(bytes)
bytes |
Unspecified. |
Unspecified.
DuckDB macro pg_sleep().
pg_sleep(seconds)pg_sleep(seconds)
seconds |
Unspecified. |
Unspecified.
DuckDB macro pg_table_is_visible().
pg_table_is_visible(table_oid)pg_table_is_visible(table_oid)
table_oid |
Unspecified. |
Unspecified.
DuckDB function pg_timezone_names().
pg_timezone_names()pg_timezone_names()
Unspecified.
The icu extension (LOAD icu;).
DuckDB macro pg_ts_config_is_visible().
pg_ts_config_is_visible(config_oid)pg_ts_config_is_visible(config_oid)
config_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_ts_dict_is_visible().
pg_ts_dict_is_visible(dict_oid)pg_ts_dict_is_visible(dict_oid)
dict_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_ts_parser_is_visible().
pg_ts_parser_is_visible(parser_oid)pg_ts_parser_is_visible(parser_oid)
parser_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_ts_template_is_visible().
pg_ts_template_is_visible(template_oid)pg_ts_template_is_visible(template_oid)
template_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_type_is_visible().
pg_type_is_visible(type_oid)pg_type_is_visible(type_oid)
type_oid |
Unspecified. |
Unspecified.
DuckDB macro pg_typeof().
pg_typeof(expression)pg_typeof(expression)
expression |
Unspecified. |
Unspecified.
Returns the value of pi.
pi()pi()
DOUBLE
pi()
DuckDB function platform().
platform()platform()
Unspecified.
DuckDB function postgres_attach().
postgres_attach(col0, suffix, sink_schema, filter_pushdown, source_schema, overwrite)postgres_attach(col0, suffix, sink_schema, filter_pushdown, source_schema, overwrite)
col0 |
|
suffix |
|
sink_schema |
|
filter_pushdown |
|
source_schema |
|
overwrite |
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_configure_pool().
postgres_configure_pool( health_check_query, max_lifetime_millis, enable_reaper_thread, enable_thread_local_cache, wait_timeout_millis, max_connections, idle_timeout_millis, acquire_mode, catalog_name )postgres_configure_pool( health_check_query, max_lifetime_millis, enable_reaper_thread, enable_thread_local_cache, wait_timeout_millis, max_connections, idle_timeout_millis, acquire_mode, catalog_name )
health_check_query |
|
max_lifetime_millis |
|
enable_reaper_thread |
|
enable_thread_local_cache |
|
wait_timeout_millis |
|
max_connections |
|
idle_timeout_millis |
|
acquire_mode |
|
catalog_name |
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_execute().
postgres_execute(col0, col1, use_transaction)postgres_execute(col0, col1, use_transaction)
col0 |
|
col1 |
|
use_transaction |
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_hstore_get().
postgres_hstore_get(col0, col1)postgres_hstore_get(col0, col1)
col0, col1
|
|
VARCHAR
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_hstore_to_json().
postgres_hstore_to_json(col0)postgres_hstore_to_json(col0)
col0 |
|
JSON
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_query().
postgres_query(col0, col1, params, use_transaction)postgres_query(col0, col1, params, use_transaction)
col0 |
|
col1 |
|
params |
|
use_transaction |
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_scan().
postgres_scan(col0, col1, col2)postgres_scan(col0, col1, col2)
col0, col1, col2
|
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function postgres_scan_pushdown().
postgres_scan_pushdown(col0, col1, col2)postgres_scan_pushdown(col0, col1, col2)
col0, col1, col2
|
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
Computes x to the power of y.
pow(x, y)pow(x, y)
x, y
|
|
DOUBLE
pow(2, 3) power(2, 3) 2 ** 3 2 ^ 3
DuckDB function pragma_collations().
pragma_collations()pragma_collations()
Unspecified.
DuckDB function pragma_database_size().
pragma_database_size()pragma_database_size()
Unspecified.
DuckDB function pragma_hnsw_index_info().
pragma_hnsw_index_info()pragma_hnsw_index_info()
Unspecified.
The vss extension (LOAD vss;).
DuckDB function pragma_metadata_info().
pragma_metadata_info(col0)pragma_metadata_info(col0)
col0 |
|
Unspecified.
pragma_metadata_info()
pragma_metadata_info(col0 = VARCHAR)
DuckDB function pragma_platform().
pragma_platform()pragma_platform()
Unspecified.
DuckDB function pragma_rtree_index_info().
pragma_rtree_index_info()pragma_rtree_index_info()
Unspecified.
The spatial extension (LOAD spatial;).
DuckDB function pragma_show().
pragma_show(col0)pragma_show(col0)
col0 |
|
Unspecified.
DuckDB function pragma_storage_info().
pragma_storage_info(col0)pragma_storage_info(col0)
col0 |
|
Unspecified.
DuckDB function pragma_table_info().
pragma_table_info(col0)pragma_table_info(col0)
col0 |
|
Unspecified.
DuckDB function pragma_user_agent().
pragma_user_agent()pragma_user_agent()
Unspecified.
DuckDB function pragma_version().
pragma_version()pragma_version()
Unspecified.
Returns true if string starts with search_string.
prefix(string, search_string)prefix(string, search_string)
string, search_string
|
|
BOOLEAN
prefix('abc', 'ab')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Formats a string using printf syntax.
printf(format)printf(format)
format |
|
VARCHAR
printf('Benchmark "%s" took %d seconds', 'CSV', 42)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Calculates the product of all tuples in arg.
product(arg)product(arg)
arg |
|
DOUBLE
product(A)
DuckDB function quack_active_connections().
quack_active_connections()quack_active_connections()
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_check_token().
quack_check_token(col0, col1, col2)quack_check_token(col0, col1, col2)
col0, col1, col2
|
|
BOOLEAN
The quack extension (LOAD quack;).
DuckDB function quack_clear_cache().
quack_clear_cache()quack_clear_cache()
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_identify().
quack_identify(meta, region, hostname, provider, name)quack_identify(meta, region, hostname, provider, name)
meta, region, hostname, provider, name
|
|
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_nop_authorization().
quack_nop_authorization(col0, col1)quack_nop_authorization(col0, col1)
col0, col1
|
|
VARCHAR
The quack extension (LOAD quack;).
DuckDB function quack_query().
quack_query(col0, col1, token, disable_ssl)quack_query(col0, col1, token, disable_ssl)
col0 |
|
col1 |
|
token |
|
disable_ssl |
|
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_query_by_name().
quack_query_by_name(col0, col1)quack_query_by_name(col0, col1)
col0, col1
|
|
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_serve().
quack_serve(col0, token, allow_other_hostname, disable_ssl)quack_serve(col0, token, allow_other_hostname, disable_ssl)
col0 |
|
token |
|
allow_other_hostname |
|
disable_ssl |
|
Unspecified.
quack_serve(col0 = VARCHAR, token = VARCHAR, allow_other_hostname = BOOLEAN, disable_ssl = BOOLEAN)
quack_serve(token = VARCHAR, allow_other_hostname = BOOLEAN, disable_ssl = BOOLEAN)
The quack extension (LOAD quack;).
DuckDB function quack_server_list().
quack_server_list()quack_server_list()
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_stop().
quack_stop(col0)quack_stop(col0)
col0 |
|
Unspecified.
The quack extension (LOAD quack;).
DuckDB function quack_uri_parser().
quack_uri_parser(col0, col1)quack_uri_parser(col0, col1)
col0 |
|
col1 |
|
STRUCT(host VARCHAR, port USMALLINT, ipv6 BOOLEAN, ssl BOOLEAN, url VARCHAR)
The quack extension (LOAD quack;).
Returns the interpolated quantile number between 0 and 1 . If pos is a LIST of FLOATs, then the result is a LIST of the corresponding interpolated quantiles. .
quantile_cont(x, pos)quantile_cont(x, pos)
x |
|
pos |
|
DECIMAL | TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DATE | TIMESTAMP | TIME | TIMESTAMP WITH TIME ZONE | TIME WITH TIME ZONE
quantile_cont(x, 0.5)
Returns the exact quantile number between 0 and 1 . If pos is a LIST of FLOATs, then the result is a LIST of the corresponding exact quantiles.
quantile_disc(x, pos)quantile_disc(x, pos)
x |
|
pos |
|
ANY
quantile_disc(x = ANY, pos = DOUBLE)
quantile_disc(x = ANY, pos = `DOUBLE[]`)
quantile_disc(x = ANY)
quantile_disc(x, 0.5)
Extract the quarter component from a date or timestamp.
quarter(ts)quarter(ts)
ts |
|
BIGINT
quarter(timestamp '2021-08-03 11:59:44.123456')
DuckDB function query().
query(col0)query(col0)
col0 |
|
Unspecified.
DuckDB function query_table().
query_table(col0)query_table(col0)
col0 |
|
Unspecified.
query_table(col0 = VARCHAR)
query_table(col0 = `VARCHAR[]`)
query_table(col0 = `VARCHAR[]`, col1 = BOOLEAN)
DuckDB function r_dataframe_scan().
r_dataframe_scan(col0, map_list_of, experimental, integer64)r_dataframe_scan(col0, map_list_of, experimental, integer64)
col0 |
|
map_list_of |
|
experimental |
|
integer64 |
|
Unspecified.
Converts degrees to radians.
radians(x)radians(x)
x |
|
DOUBLE
radians(90)
Returns a random number between 0 and 1.
random()random()
DOUBLE
random()
Creates a list of values between start and stop - the stop parameter is exclusive.
range(start, stop, step)range(start, stop, step)
start |
|
stop |
|
step |
|
BIGINT[] | TIMESTAMP[] | TIMESTAMP WITH TIME ZONE[]
range(col0 = BIGINT)
range(col0 = BIGINT, col1 = BIGINT)
range(col0 = BIGINT, col1 = BIGINT, col2 = BIGINT)
range(col0 = TIMESTAMP, col1 = TIMESTAMP, col2 = INTERVAL)
range(col0 = `TIMESTAMP WITH TIME ZONE`, col1 = `TIMESTAMP WITH TIME ZONE`, col2 = INTERVAL)
range(start = BIGINT)
range(start = BIGINT, stop = BIGINT)
range(start = BIGINT, stop = BIGINT, step = BIGINT)
range(start = TIMESTAMP, stop = TIMESTAMP, step = INTERVAL)
range(start = `TIMESTAMP WITH TIME ZONE`, stop = `TIMESTAMP WITH TIME ZONE`, step = INTERVAL)
range(col0 = BIGINT): built in
range(col0 = BIGINT, col1 = BIGINT): built in
range(col0 = BIGINT, col1 = BIGINT, col2 = BIGINT): built in
range(col0 = TIMESTAMP, col1 = TIMESTAMP, col2 = INTERVAL): built in
range(col0 = `TIMESTAMP WITH TIME ZONE`, col1 = `TIMESTAMP WITH TIME ZONE`, col2 = INTERVAL): icu
range(start = BIGINT): built in
range(start = BIGINT, stop = BIGINT): built in
range(start = BIGINT, stop = BIGINT, step = BIGINT): built in
range(start = TIMESTAMP, stop = TIMESTAMP, step = INTERVAL): built in
range(start = `TIMESTAMP WITH TIME ZONE`, stop = `TIMESTAMP WITH TIME ZONE`, step = INTERVAL): built in
range(2, 5, 3)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
repeat(),
unpivot_list()
DuckDB function rank_dense().
rank_dense()rank_dense()
BIGINT
DuckDB function read_avro().
read_avro( col0, hive_types_autocast, hive_types, hive_partitioning, union_by_name, filename )read_avro( col0, hive_types_autocast, hive_types, hive_partitioning, union_by_name, filename )
col0 |
|
hive_types_autocast |
|
hive_types |
|
hive_partitioning |
|
union_by_name |
|
filename |
|
Unspecified.
The avro extension (LOAD avro;).
DuckDB function read_blob().
read_blob(col0)read_blob(col0)
col0 |
|
Unspecified.
DuckDB function read_csv().
read_csv( col0, thousands, strict_mode, dtypes, column_types, null_padding, column_names, buffer_size, parallel, force_not_null, hive_types, new_line, files_to_sniff, dateformat, delim, sep, decimal_separator, nullstr, escape, compression, encoding, hive_types_autocast, all_varchar, columns, hive_partitioning, auto_detect, comment, quote, max_line_size, store_rejects, union_by_name, header, types, skip, filename, sample_size, timestampformat, normalize_names, ignore_errors, names, allow_quoted_nulls, maximum_line_size, rejects_table, auto_type_candidates, rejects_scan, rejects_limit )read_csv( col0, thousands, strict_mode, dtypes, column_types, null_padding, column_names, buffer_size, parallel, force_not_null, hive_types, new_line, files_to_sniff, dateformat, delim, sep, decimal_separator, nullstr, escape, compression, encoding, hive_types_autocast, all_varchar, columns, hive_partitioning, auto_detect, comment, quote, max_line_size, store_rejects, union_by_name, header, types, skip, filename, sample_size, timestampformat, normalize_names, ignore_errors, names, allow_quoted_nulls, maximum_line_size, rejects_table, auto_type_candidates, rejects_scan, rejects_limit )
col0 |
|
thousands |
|
strict_mode |
|
dtypes |
|
column_types |
|
null_padding |
|
column_names |
|
buffer_size |
|
parallel |
|
force_not_null |
|
hive_types |
|
new_line |
|
files_to_sniff |
|
dateformat |
|
delim |
|
sep |
|
decimal_separator |
|
nullstr |
|
escape |
|
compression |
|
encoding |
|
hive_types_autocast |
|
all_varchar |
|
columns |
|
hive_partitioning |
|
auto_detect |
|
comment |
|
quote |
|
max_line_size |
|
store_rejects |
|
union_by_name |
|
header |
|
types |
|
skip |
|
filename |
|
sample_size |
|
timestampformat |
|
normalize_names |
|
ignore_errors |
|
names |
|
allow_quoted_nulls |
|
maximum_line_size |
|
rejects_table |
|
auto_type_candidates |
|
rejects_scan |
|
rejects_limit |
|
Unspecified.
DuckDB function read_csv_auto().
read_csv_auto( col0, thousands, strict_mode, dtypes, column_types, null_padding, column_names, buffer_size, parallel, force_not_null, hive_types, new_line, files_to_sniff, dateformat, delim, sep, decimal_separator, nullstr, escape, compression, encoding, hive_types_autocast, all_varchar, columns, hive_partitioning, auto_detect, comment, quote, max_line_size, store_rejects, union_by_name, header, types, skip, filename, sample_size, timestampformat, normalize_names, ignore_errors, names, allow_quoted_nulls, maximum_line_size, rejects_table, auto_type_candidates, rejects_scan, rejects_limit )read_csv_auto( col0, thousands, strict_mode, dtypes, column_types, null_padding, column_names, buffer_size, parallel, force_not_null, hive_types, new_line, files_to_sniff, dateformat, delim, sep, decimal_separator, nullstr, escape, compression, encoding, hive_types_autocast, all_varchar, columns, hive_partitioning, auto_detect, comment, quote, max_line_size, store_rejects, union_by_name, header, types, skip, filename, sample_size, timestampformat, normalize_names, ignore_errors, names, allow_quoted_nulls, maximum_line_size, rejects_table, auto_type_candidates, rejects_scan, rejects_limit )
col0 |
|
thousands |
|
strict_mode |
|
dtypes |
|
column_types |
|
null_padding |
|
column_names |
|
buffer_size |
|
parallel |
|
force_not_null |
|
hive_types |
|
new_line |
|
files_to_sniff |
|
dateformat |
|
delim |
|
sep |
|
decimal_separator |
|
nullstr |
|
escape |
|
compression |
|
encoding |
|
hive_types_autocast |
|
all_varchar |
|
columns |
|
hive_partitioning |
|
auto_detect |
|
comment |
|
quote |
|
max_line_size |
|
store_rejects |
|
union_by_name |
|
header |
|
types |
|
skip |
|
filename |
|
sample_size |
|
timestampformat |
|
normalize_names |
|
ignore_errors |
|
names |
|
allow_quoted_nulls |
|
maximum_line_size |
|
rejects_table |
|
auto_type_candidates |
|
rejects_scan |
|
rejects_limit |
|
Unspecified.
DuckDB function read_duckdb().
read_duckdb( col0, table_name, schema_name, hive_types_autocast, hive_types, hive_partitioning, union_by_name, filename )read_duckdb( col0, table_name, schema_name, hive_types_autocast, hive_types, hive_partitioning, union_by_name, filename )
col0 |
|
table_name |
|
schema_name |
|
hive_types_autocast |
|
hive_types |
|
hive_partitioning |
|
union_by_name |
|
filename |
|
Unspecified.
DuckDB function read_json().
read_json( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )read_json( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )
col0 |
|
convert_strings_to_integers |
|
maximum_sample_files |
|
timestamp_format |
|
field_appearance_threshold |
|
timestampformat |
|
map_inference_threshold |
|
date_format |
|
filename |
|
union_by_name |
|
compression |
|
maximum_depth |
|
columns |
|
sample_size |
|
hive_types |
|
hive_types_autocast |
|
maximum_object_size |
|
format |
|
ignore_errors |
|
hive_partitioning |
|
auto_detect |
|
records |
|
dateformat |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_json_auto().
read_json_auto( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )read_json_auto( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )
col0 |
|
convert_strings_to_integers |
|
maximum_sample_files |
|
timestamp_format |
|
field_appearance_threshold |
|
timestampformat |
|
map_inference_threshold |
|
date_format |
|
filename |
|
union_by_name |
|
compression |
|
maximum_depth |
|
columns |
|
sample_size |
|
hive_types |
|
hive_types_autocast |
|
maximum_object_size |
|
format |
|
ignore_errors |
|
hive_partitioning |
|
auto_detect |
|
records |
|
dateformat |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_json_objects().
read_json_objects( col0, ignore_errors, format, maximum_object_size, hive_types_autocast, hive_types, hive_partitioning, compression, union_by_name, filename )read_json_objects( col0, ignore_errors, format, maximum_object_size, hive_types_autocast, hive_types, hive_partitioning, compression, union_by_name, filename )
col0 |
|
ignore_errors |
|
format |
|
maximum_object_size |
|
hive_types_autocast |
|
hive_types |
|
hive_partitioning |
|
compression |
|
union_by_name |
|
filename |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_json_objects_auto().
read_json_objects_auto( col0, ignore_errors, format, maximum_object_size, hive_types_autocast, hive_types, hive_partitioning, compression, union_by_name, filename )read_json_objects_auto( col0, ignore_errors, format, maximum_object_size, hive_types_autocast, hive_types, hive_partitioning, compression, union_by_name, filename )
col0 |
|
ignore_errors |
|
format |
|
maximum_object_size |
|
hive_types_autocast |
|
hive_types |
|
hive_partitioning |
|
compression |
|
union_by_name |
|
filename |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_ndjson().
read_ndjson( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )read_ndjson( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )
col0 |
|
convert_strings_to_integers |
|
maximum_sample_files |
|
timestamp_format |
|
field_appearance_threshold |
|
timestampformat |
|
map_inference_threshold |
|
date_format |
|
filename |
|
union_by_name |
|
compression |
|
maximum_depth |
|
columns |
|
sample_size |
|
hive_types |
|
hive_types_autocast |
|
maximum_object_size |
|
format |
|
ignore_errors |
|
hive_partitioning |
|
auto_detect |
|
records |
|
dateformat |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_ndjson_auto().
read_ndjson_auto( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )read_ndjson_auto( col0, convert_strings_to_integers, maximum_sample_files, timestamp_format, field_appearance_threshold, timestampformat, map_inference_threshold, date_format, filename, union_by_name, compression, maximum_depth, columns, sample_size, hive_types, hive_types_autocast, maximum_object_size, format, ignore_errors, hive_partitioning, auto_detect, records, dateformat )
col0 |
|
convert_strings_to_integers |
|
maximum_sample_files |
|
timestamp_format |
|
field_appearance_threshold |
|
timestampformat |
|
map_inference_threshold |
|
date_format |
|
filename |
|
union_by_name |
|
compression |
|
maximum_depth |
|
columns |
|
sample_size |
|
hive_types |
|
hive_types_autocast |
|
maximum_object_size |
|
format |
|
ignore_errors |
|
hive_partitioning |
|
auto_detect |
|
records |
|
dateformat |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_ndjson_objects().
read_ndjson_objects( col0, ignore_errors, format, maximum_object_size, hive_types_autocast, hive_types, hive_partitioning, compression, union_by_name, filename )read_ndjson_objects( col0, ignore_errors, format, maximum_object_size, hive_types_autocast, hive_types, hive_partitioning, compression, union_by_name, filename )
col0 |
|
ignore_errors |
|
format |
|
maximum_object_size |
|
hive_types_autocast |
|
hive_types |
|
hive_partitioning |
|
compression |
|
union_by_name |
|
filename |
|
Unspecified.
The json extension (LOAD json;).
DuckDB function read_parquet().
read_parquet( col0, can_have_nan, filename, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types, schema )read_parquet( col0, can_have_nan, filename, union_by_name, debug_use_openssl, hive_partitioning, parquet_version, encryption_config, hive_types_autocast, binary_as_string, explicit_cardinality, compression, file_row_number, hive_types, schema )
col0 |
|
can_have_nan |
|
filename |
|
union_by_name |
|
debug_use_openssl |
|
hive_partitioning |
|
parquet_version |
|
encryption_config |
|
hive_types_autocast |
|
binary_as_string |
|
explicit_cardinality |
|
compression |
|
file_row_number |
|
hive_types |
|
schema |
|
Unspecified.
DuckDB function read_postgres_binary().
read_postgres_binary(col0, buffer_size, columns)read_postgres_binary(col0, buffer_size, columns)
col0 |
|
buffer_size |
|
columns |
|
Unspecified.
The postgres_scanner extension (LOAD postgres_scanner;).
DuckDB function read_text().
read_text(col0)read_text(col0)
col0 |
|
Unspecified.
DuckDB function read_vortex().
read_vortex(col0)read_vortex(col0)
col0 |
|
Unspecified.
The vortex extension (LOAD vortex;).
DuckDB function read_xlsx().
read_xlsx( col0, normalize_names, empty_as_varchar, stop_at_empty, sheet, range, ignore_errors, all_varchar, header )read_xlsx( col0, normalize_names, empty_as_varchar, stop_at_empty, sheet, range, ignore_errors, all_varchar, header )
col0 |
|
normalize_names |
|
empty_as_varchar |
|
stop_at_empty |
|
sheet |
|
range |
|
ignore_errors |
|
all_varchar |
|
header |
|
Unspecified.
The excel extension (LOAD excel;).
Escapes special patterns to turn string into a regular expression similarly to Python's re.escape function.
regexp_escape(string)regexp_escape(string)
string |
|
VARCHAR
regexp_escape('https://duckdb.org')
Other regex:
regexp_extract(),
regexp_extract_all(),
regexp_full_match(),
regexp_matches(),
regexp_replace(),
string_split_regex()
regexp_extract(string = VARCHAR, regex = VARCHAR), regexp_extract(string = VARCHAR, regex = VARCHAR, group = INTEGER), regexp_extract(string = VARCHAR, regex = VARCHAR, group = INTEGER, options = VARCHAR): If string contains the regex pattern, returns the capturing group specified by optional parameter group; otherwise, returns the empty string. The group must be a constant value. If no group is given, it defaults to 0. A set of optional regex options can be set.
regexp_extract(string = VARCHAR, regex = VARCHAR, name_list = `VARCHAR[]`), regexp_extract(string = VARCHAR, regex = VARCHAR, name_list = `VARCHAR[]`, options = VARCHAR): If string contains the regex pattern, returns the capturing groups as a struct with corresponding names from name_list; otherwise, returns a struct with the same keys and empty strings as values. A set of optional regex options can be set.
regexp_extract(string, regex, group, options)regexp_extract(string, regex, group, options)
string |
|
regex |
|
group |
|
options |
|
VARCHAR
regexp_extract(string = VARCHAR, regex = VARCHAR)
regexp_extract(string = VARCHAR, regex = VARCHAR, group = INTEGER)
regexp_extract(string = VARCHAR, regex = VARCHAR, group = INTEGER, options = VARCHAR)
regexp_extract(string = VARCHAR, regex = VARCHAR, name_list = `VARCHAR[]`)
regexp_extract(string = VARCHAR, regex = VARCHAR, name_list = `VARCHAR[]`, options = VARCHAR)
regexp_extract('abcde', '[a-z]{3}')
regexp_extract('abc', '([a-z])(b)', 1)
regexp_extract('ABC', '([a-z])(b)', 1, 'i')
regexp_extract('2023-04-15', '(\d+)-(\d+)-(\d+)', ['y', 'm', 'd'])
regexp_extract('John Doe', '([a-z]+) ([a-z]+)', ['first_name', 'last_name'], 'i')
Other regex:
regexp_escape(),
regexp_extract_all(),
regexp_full_match(),
regexp_matches(),
regexp_replace(),
string_split_regex()
Finds non-overlapping occurrences of the regex in the string and returns the corresponding values of the capturing group. A set of optional regex options can be set.
regexp_extract_all(string, regex, group, options)regexp_extract_all(string, regex, group, options)
string |
|
regex |
|
group |
|
options |
|
VARCHAR[]
regexp_extract_all(string = VARCHAR, regex = VARCHAR)
regexp_extract_all(string = VARCHAR, regex = VARCHAR, group = INTEGER)
regexp_extract_all(string = VARCHAR, regex = VARCHAR, group = INTEGER, options = VARCHAR)
regexp_extract_all(string = VARCHAR, regex = VARCHAR, group = `VARCHAR[]`)
regexp_extract_all(string = VARCHAR, regex = VARCHAR, group = `VARCHAR[]`, options = VARCHAR)
regexp_extract_all('Peter: 33, Paul:14', '(\w+):\s*(\d+)', 2)
Other regex:
regexp_escape(),
regexp_extract(),
regexp_full_match(),
regexp_matches(),
regexp_replace(),
string_split_regex()
Returns true if the entire string matches the regex. A set of optional regex options can be set.
regexp_full_match(string, regex, col2)regexp_full_match(string, regex, col2)
string, regex, col2
|
|
BOOLEAN
regexp_full_match(string = VARCHAR, regex = VARCHAR)
regexp_full_match(string = VARCHAR, regex = VARCHAR, col2 = VARCHAR)
regexp_full_match('anabanana', '(an)*')
Other regex:
regexp_escape(),
regexp_extract(),
regexp_extract_all(),
regexp_matches(),
regexp_replace(),
string_split_regex()
Returns true if string contains the regex, false otherwise. A set of optional regex options can be set.
regexp_matches(string, regex, options)regexp_matches(string, regex, options)
string, regex, options
|
|
BOOLEAN
regexp_matches(string = VARCHAR, regex = VARCHAR)
regexp_matches(string = VARCHAR, regex = VARCHAR, options = VARCHAR)
regexp_matches('anabanana', '(an)*')
Other regex:
regexp_escape(),
regexp_extract(),
regexp_extract_all(),
regexp_full_match(),
regexp_replace(),
string_split_regex()
If string contains the regex, replaces the matching part with replacement. A set of optional regex options can be set.
regexp_replace(string, regex, replacement, options)regexp_replace(string, regex, replacement, options)
string, regex, replacement, options
|
|
VARCHAR
regexp_replace(string = VARCHAR, regex = VARCHAR, replacement = VARCHAR)
regexp_replace(string = VARCHAR, regex = VARCHAR, replacement = VARCHAR, options = VARCHAR)
regexp_replace('hello', '[lo]', '-')
Other regex:
regexp_escape(),
regexp_extract(),
regexp_extract_all(),
regexp_full_match(),
regexp_matches(),
string_split_regex()
DuckDB macro regexp_split_to_table().
regexp_split_to_table(text, pattern)regexp_split_to_table(text, pattern)
text, pattern
|
Unspecified. |
Unspecified.
Returns the average of the independent variable for non-NULL pairs in a group, where x is the independent variable and y is the dependent variable.
regr_avgx(y, x)regr_avgx(y, x)
y, x
|
|
DOUBLE
Returns the average of the dependent variable for non-NULL pairs in a group, where x is the independent variable and y is the dependent variable.
regr_avgy(y, x)regr_avgy(y, x)
y, x
|
|
DOUBLE
Returns the number of non-NULL number pairs in a group.
regr_count(y, x)regr_count(y, x)
y, x
|
|
UINTEGER
(SUM(x*y) - SUM(x) * SUM(y) / COUNT(*)) / COUNT(*)
Returns the intercept of the univariate linear regression line for non-NULL pairs in a group.
regr_intercept(y, x)regr_intercept(y, x)
y, x
|
|
DOUBLE
AVG(y)-REGR_SLOPE(y, x)*AVG(x)
Returns the coefficient of determination for non-NULL pairs in a group.
regr_r2(y, x)regr_r2(y, x)
y, x
|
|
DOUBLE
Returns the slope of the linear regression line for non-NULL pairs in a group.
regr_slope(y, x)regr_slope(y, x)
y, x
|
|
DOUBLE
COVAR_POP(x, y) / VAR_POP(x)
DuckDB function regr_sxx().
regr_sxx(y, x)regr_sxx(y, x)
y, x
|
|
DOUBLE
REGR_COUNT(y, x) * VAR_POP(x)
Returns the population covariance of input values.
regr_sxy(y, x)regr_sxy(y, x)
y, x
|
|
DOUBLE
REGR_COUNT(y, x) * COVAR_POP(y, x)
DuckDB function regr_syy().
regr_syy(y, x)regr_syy(y, x)
y, x
|
|
DOUBLE
REGR_COUNT(y, x) * VAR_POP(y)
Map a struct to another struct type, potentially re-ordering, renaming and casting members and filling in defaults for missing values.
remap_struct(input, target_type, mapping, defaults)remap_struct(input, target_type, mapping, defaults)
input, target_type, mapping, defaults
|
|
ANY
remap_struct({'i': 1, 'j': 2}, NULL::ROW(v1 INT, v2 INT, v3 INT), {'v1': 'j', 'v3': 'i'}, {'v2': NULL::INTEGER})
DuckDB function remove_iceberg_schema_properties().
remove_iceberg_schema_properties(col0, col1)remove_iceberg_schema_properties(col0, col1)
col0 |
|
col1 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function remove_iceberg_table_properties().
remove_iceberg_table_properties(col0, col1)remove_iceberg_table_properties(col0, col1)
col0 |
|
col1 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
`repeat`(string = VARCHAR, count = BIGINT): Repeats the string count number of times.
`repeat`(blob = BLOB, count = BIGINT): Repeats the blob count number of times.
`repeat`(list = `T[]`, count = BIGINT): Repeats the list count number of times.
`repeat`(col0 = ANY, col1 = BIGINT): (Description missing.)
`repeat`(string, count)`repeat`(string, count)
string |
|
count |
|
VARCHAR | BLOB | T[]
`repeat`(col0 = ANY, col1 = BIGINT)
`repeat`(string = VARCHAR, count = BIGINT)
`repeat`(blob = BLOB, count = BIGINT)
`repeat`(list = `T[]`, count = BIGINT)
repeat('A', 5)
repeat('\xAA\xBB'::BLOB, 5)
repeat([1, 2, 3], 5)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
sha1(),
sha256(),
to_base64(),
unbin(),
unhex()
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
unpivot_list()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function repeat_row().
repeat_row(num_rows)repeat_row(num_rows)
num_rows |
|
Unspecified.
Replaces any occurrences of the source with target in string.
replace(string, source, target)replace(string, source, target)
string, source, target
|
|
VARCHAR
replace('hello', 'l', '-')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Casts all fields of type1 to type2.
replace_type(param, type1, type2)replace_type(param, type1, type2)
param, type1, type2
|
|
ANY
replace_type({duck: 3.141592653589793::DOUBLE}, NULL::DOUBLE, NULL::DECIMAL(15,2))
Gives the approximate quantile using reservoir sampling, the sample size is optional and uses 8192 as a default size.
reservoir_quantile(x, quantile, sample_size)reservoir_quantile(x, quantile, sample_size)
x |
|
quantile |
|
sample_size |
|
DECIMAL | DECIMAL[] | TINYINT | TINYINT[] | SMALLINT | SMALLINT[] | INTEGER | INTEGER[] | BIGINT | BIGINT[] | HUGEINT | HUGEINT[] | FLOAT | FLOAT[] | DOUBLE | DOUBLE[]
reservoir_quantile(x = DECIMAL, quantile = DOUBLE)
reservoir_quantile(x = DECIMAL, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = DECIMAL, quantile = `DOUBLE[]`)
reservoir_quantile(x = DECIMAL, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = TINYINT, quantile = DOUBLE)
reservoir_quantile(x = TINYINT, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = TINYINT, quantile = `DOUBLE[]`)
reservoir_quantile(x = TINYINT, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = SMALLINT, quantile = DOUBLE)
reservoir_quantile(x = SMALLINT, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = SMALLINT, quantile = `DOUBLE[]`)
reservoir_quantile(x = SMALLINT, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = INTEGER, quantile = DOUBLE)
reservoir_quantile(x = INTEGER, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = INTEGER, quantile = `DOUBLE[]`)
reservoir_quantile(x = INTEGER, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = BIGINT, quantile = DOUBLE)
reservoir_quantile(x = BIGINT, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = BIGINT, quantile = `DOUBLE[]`)
reservoir_quantile(x = BIGINT, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = HUGEINT, quantile = DOUBLE)
reservoir_quantile(x = HUGEINT, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = HUGEINT, quantile = `DOUBLE[]`)
reservoir_quantile(x = HUGEINT, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = FLOAT, quantile = DOUBLE)
reservoir_quantile(x = FLOAT, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = FLOAT, quantile = `DOUBLE[]`)
reservoir_quantile(x = FLOAT, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(x = DOUBLE, quantile = DOUBLE)
reservoir_quantile(x = DOUBLE, quantile = DOUBLE, sample_size = INTEGER)
reservoir_quantile(x = DOUBLE, quantile = `DOUBLE[]`)
reservoir_quantile(x = DOUBLE, quantile = `DOUBLE[]`, sample_size = INTEGER)
reservoir_quantile(A, 0.5, 1024)
Reverses the string.
reverse(string)reverse(string)
string |
|
VARCHAR
reverse('hello')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Extract the right-most count characters.
right(string, count)right(string, count)
string |
|
count |
|
VARCHAR
right('Hello🦆', 3)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Extracts the right-most count grapheme clusters.
right_grapheme(string, count)right_grapheme(string, count)
string |
|
count |
|
VARCHAR
right_grapheme('🤦🏼♂️🤦🏽♀️', 1)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Rounds x to s decimal places.
round(x, precision)round(x, precision)
x |
|
precision |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL
round(x = TINYINT)
round(x = TINYINT, precision = INTEGER)
round(x = SMALLINT)
round(x = SMALLINT, precision = INTEGER)
round(x = INTEGER)
round(x = INTEGER, precision = INTEGER)
round(x = BIGINT)
round(x = BIGINT, precision = INTEGER)
round(x = HUGEINT)
round(x = HUGEINT, precision = INTEGER)
round(x = FLOAT)
round(x = FLOAT, precision = INTEGER)
round(x = DOUBLE)
round(x = DOUBLE, precision = INTEGER)
round(x = DECIMAL)
round(x = DECIMAL, precision = INTEGER)
round(42.4332, 2)
DuckDB macro round_even().
round_even(x, n)round_even(x, n)
x, n
|
Unspecified. |
Unspecified.
DuckDB macro roundbankers().
roundbankers(x, n)roundbankers(x, n)
x, n
|
Unspecified. |
Unspecified.
Create an unnamed STRUCT (tuple) containing the argument values.
row()row()
STRUCT
row(i, i % 4, i / 4)
DuckDB function row_number().
row_number()row_number()
BIGINT
DuckDB function row_to_json().
row_to_json()row_to_json()
JSON
The json extension (LOAD json;).
Pads the string with the character on the right until it has count characters. Truncates the string on the right if it has more than count characters.
rpad(string, count, character)rpad(string, count, character)
string |
|
count |
|
character |
|
VARCHAR
rpad('hello', 10, '<')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function rtree_index_dump().
rtree_index_dump(col0)rtree_index_dump(col0)
col0 |
|
Unspecified.
The spatial extension (LOAD spatial;).
DuckDB function rtree_index_scan().
rtree_index_scan()rtree_index_scan()
Unspecified.
The spatial extension (LOAD spatial;).
Removes any occurrences of any of the characters from the right side of the string. characters defaults to space.
rtrim(string, characters)rtrim(string, characters)
string, characters
|
|
VARCHAR
rtrim(string = VARCHAR)
rtrim(string = VARCHAR, characters = VARCHAR)
rtrim(' test ')
rtrim('>>>>test<<', '><')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Extract the second component from a date or timestamp.
second(ts)second(ts)
ts |
|
BIGINT
second(timestamp '2021-08-03 11:59:44.123456')
Returns the standard error of the mean.
sem(x)sem(x)
x |
|
DOUBLE
DuckDB function seq_scan().
seq_scan()seq_scan()
Unspecified.
DuckDB macro session_user().
session_user()session_user()
Unspecified.
Sets the nth bit in bitstring to newvalue; the first (leftmost) bit is indexed 0. Returns a new bitstring.
set_bit(bitstring, index, new_value)set_bit(bitstring, index, new_value)
bitstring |
|
index |
|
new_value |
|
BIT
set_bit('0110010'::BIT, 2, 0)
DuckDB function set_iceberg_schema_properties().
set_iceberg_schema_properties(col0, col1)set_iceberg_schema_properties(col0, col1)
col0 |
|
col1 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
DuckDB function set_iceberg_table_properties().
set_iceberg_table_properties(col0, col1)set_iceberg_table_properties(col0, col1)
col0 |
|
col1 |
|
Unspecified.
The iceberg extension (LOAD iceberg;).
Sets the seed to be used for the random function.
setseed(col0)setseed(col0)
col0 |
|
"NULL"
setseed(0.42)
sha1(value = VARCHAR): Returns a VARCHAR with the SHA-1 hash of the value.
sha1(blob = BLOB): Returns a VARCHAR with the SHA-1 hash of the blob.
sha1(value)sha1(value)
value |
|
VARCHAR
sha1(value = VARCHAR)
sha1(blob = BLOB)
sha1('🦆')
sha1('\xAA\xBB'::BLOB)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha256(),
to_base64(),
unbin(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
sha256(value = VARCHAR): Returns a VARCHAR with the SHA-256 hash of the value.
sha256(blob = BLOB): Returns a VARCHAR with the SHA-256 hash of the blob.
sha256(value)sha256(value)
value |
|
VARCHAR
sha256(value = VARCHAR)
sha256(blob = BLOB)
sha256('🦆')
sha256('\xAA\xBB'::BLOB)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
to_base64(),
unbin(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function shapefile_meta().
shapefile_meta(col0)shapefile_meta(col0)
col0 |
|
Unspecified.
The spatial extension (LOAD spatial;).
DuckDB macro shobj_description().
shobj_description(object_oid, catalog_name)shobj_description(object_oid, catalog_name)
object_oid, catalog_name
|
Unspecified. |
Unspecified.
DuckDB function show().
show(col0)show(col0)
col0 |
|
Unspecified.
DuckDB function show_databases().
show_databases()show_databases()
Unspecified.
DuckDB function show_tables().
show_tables()show_tables()
Unspecified.
DuckDB function show_tables_expanded().
show_tables_expanded()show_tables_expanded()
Unspecified.
Returns the sign of x as -1, 0 or 1.
sign(x)sign(x)
x |
|
TINYINT
sign(-349)
Returns whether the signbit is set or not.
signbit(x)signbit(x)
x |
|
BOOLEAN
signbit(-0.0)
Computes the sin of x.
sin(x)sin(x)
x |
|
DOUBLE
sin(90)
Computes the hyperbolic sin of x.
sinh(x)sinh(x)
x |
|
DOUBLE
sinh(1)
Returns the skewness of all input values.
skewness(x)skewness(x)
x |
|
DOUBLE
skewness(A)
Sleeps for the specified number of milliseconds and returns NULL.
sleep_ms(milliseconds)sleep_ms(milliseconds)
milliseconds |
|
"NULL"
sleep_ms(100)
DuckDB function sniff_csv().
sniff_csv( col0, force_match, hive_types, union_by_name, hive_partitioning, filename, thousands, strict_mode, hive_types_autocast, encoding, dtypes, column_types, auto_detect, sample_size, files_to_sniff, dateformat, columns, all_varchar, new_line, header, types, skip, compression, comment, quote, max_line_size, store_rejects, delim, sep, column_names, buffer_size, timestampformat, normalize_names, ignore_errors, names, allow_quoted_nulls, maximum_line_size, rejects_table, force_not_null, parallel, auto_type_candidates, rejects_scan, rejects_limit, nullstr, escape, decimal_separator, null_padding )sniff_csv( col0, force_match, hive_types, union_by_name, hive_partitioning, filename, thousands, strict_mode, hive_types_autocast, encoding, dtypes, column_types, auto_detect, sample_size, files_to_sniff, dateformat, columns, all_varchar, new_line, header, types, skip, compression, comment, quote, max_line_size, store_rejects, delim, sep, column_names, buffer_size, timestampformat, normalize_names, ignore_errors, names, allow_quoted_nulls, maximum_line_size, rejects_table, force_not_null, parallel, auto_type_candidates, rejects_scan, rejects_limit, nullstr, escape, decimal_separator, null_padding )
col0 |
|
force_match |
|
hive_types |
|
union_by_name |
|
hive_partitioning |
|
filename |
|
thousands |
|
strict_mode |
|
hive_types_autocast |
|
encoding |
|
dtypes |
|
column_types |
|
auto_detect |
|
sample_size |
|
files_to_sniff |
|
dateformat |
|
columns |
|
all_varchar |
|
new_line |
|
header |
|
types |
|
skip |
|
compression |
|
comment |
|
quote |
|
max_line_size |
|
store_rejects |
|
delim |
|
sep |
|
column_names |
|
buffer_size |
|
timestampformat |
|
normalize_names |
|
ignore_errors |
|
names |
|
allow_quoted_nulls |
|
maximum_line_size |
|
rejects_table |
|
force_not_null |
|
parallel |
|
auto_type_candidates |
|
rejects_scan |
|
rejects_limit |
|
nullstr |
|
escape |
|
decimal_separator |
|
null_padding |
|
Unspecified.
DuckDB macro split_part().
split_part(string, delimiter, position)split_part(string, delimiter, position)
string, delimiter, position
|
Unspecified. |
Unspecified.
DuckDB function sql_auto_complete().
sql_auto_complete( col0, max_exact_suggestion_count, max_file_suggestion_count, max_suggestion_count )sql_auto_complete( col0, max_exact_suggestion_count, max_file_suggestion_count, max_suggestion_count )
col0 |
|
max_exact_suggestion_count |
|
max_file_suggestion_count |
|
max_suggestion_count |
|
Unspecified.
The autocomplete extension (LOAD autocomplete;).
DuckDB function sqlite_attach().
sqlite_attach(col0, overwrite)sqlite_attach(col0, overwrite)
col0 |
|
overwrite |
|
Unspecified.
The sqlite_scanner extension (LOAD sqlite_scanner;).
DuckDB function sqlite_query().
sqlite_query(col0, col1, params)sqlite_query(col0, col1, params)
col0 |
|
col1 |
|
params |
|
Unspecified.
The sqlite_scanner extension (LOAD sqlite_scanner;).
DuckDB function sqlite_scan().
sqlite_scan(col0, col1)sqlite_scan(col0, col1)
col0, col1
|
|
Unspecified.
The sqlite_scanner extension (LOAD sqlite_scanner;).
Returns the square root of x.
sqrt(x)sqrt(x)
x |
|
DOUBLE
sqrt(4)
Applies an affine transformation to a geometry.
For the 2D variant, the transformation matrix is defined as follows:
| a b xoff | | d e yoff | | 0 0 1 |
For the 3D variant, the transformation matrix is defined as follows:
| a b c xoff | | d e f yoff | | g h i zoff | | 0 0 0 1 |
The transformation is applied to all vertices of the geometry.
ST_Affine(geom, a, b, c, d, e, f, g, h, i, xoff, yoff, zoff)ST_Affine(geom, a, b, c, d, e, f, g, h, i, xoff, yoff, zoff)
geom |
|
a |
|
b |
|
c |
|
d |
|
e |
|
f |
|
g |
|
h |
|
i |
|
xoff |
|
yoff |
|
zoff |
|
GEOMETRY
ST_Affine(geom = GEOMETRY, a = DOUBLE, b = DOUBLE, c = DOUBLE, d = DOUBLE, e = DOUBLE, f = DOUBLE, g = DOUBLE, h = DOUBLE, i = DOUBLE, xoff = DOUBLE, yoff = DOUBLE, zoff = DOUBLE)
ST_Affine(geom = GEOMETRY, a = DOUBLE, b = DOUBLE, d = DOUBLE, e = DOUBLE, xoff = DOUBLE, yoff = DOUBLE)
The spatial extension (LOAD spatial;).
-- Translate a point by (2, 3)
SELECT ST_Affine(ST_Point(1, 1),
1, 0, -- a, b
0, 1, -- d, e
2, 3); -- xoff, yoff
-- POINT (3 4)
--
-- -- Scale a geometry by factor 2 in X and Y
-- SELECT ST_Affine(ST_Point(1, 1),
-- 2, 0, 0, -- a, b, c
-- 0, 2, 0, -- d, e, f
-- 0, 0, 1, -- g, h, i
-- 0, 0, 0); -- xoff, yoff, zoff
-- POINT (2 2)
Compute the area of a geometry.
Returns 0.0 for any geometry that is not a POLYGON, MULTIPOLYGON or GEOMETRYCOLLECTION containing polygon
geometries.
The area is in the same units as the spatial reference system of the geometry.
The POINT_2D and LINESTRING_2D overloads of this function always return 0.0 but are included for completeness.
ST_Area(geom)ST_Area(geom)
geom |
|
DOUBLE
ST_Area(geom = GEOMETRY)
ST_Area(polygon = POLYGON_2D)
ST_Area(linestring = LINESTRING_2D)
ST_Area(point = POINT_2D)
ST_Area(box = BOX_2D)
The spatial extension (LOAD spatial;).
SELECT ST_Area('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::GEOMETRY);
-- 1.0
Returns the area of a geometry in meters, using an ellipsoidal model of the earth
The input geometry is assumed to be in the EPSG:4326 coordinate system (WGS84), with [latitude, longitude] axis order and the area is returned in square meters. This function uses the GeographicLib library, calculating the area using an ellipsoidal model of the earth. This is a highly accurate method for calculating the area of a polygon taking the curvature of the earth into account, but is also the slowest.
Returns 0.0 for any geometry that is not a POLYGON, MULTIPOLYGON or GEOMETRYCOLLECTION containing polygon geometries.
ST_Area_Spheroid(geom)ST_Area_Spheroid(geom)
geom |
|
DOUBLE
ST_Area_Spheroid(geom = GEOMETRY)
ST_Area_Spheroid(poly = POLYGON_2D)
The spatial extension (LOAD spatial;).
Returns the geometry as a GeoJSON fragment
This does not return a complete GeoJSON document, only the geometry fragment. To construct a complete GeoJSON document or feature, look into using the DuckDB JSON extension in conjunction with this function. This function supports geometries with Z values, but not M values. M values are ignored.
ST_AsGeoJSON(geom)ST_AsGeoJSON(geom)
geom |
|
JSON
The spatial extension (LOAD spatial;).
SELECT ST_AsGeoJSON('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::GEOMETRY);
-- {"type":"Polygon","coordinates":[[[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0], [0.0, 0.0]]]}
--
-- -- Convert a geometry into a full GeoJSON feature (requires the JSON extension to be loaded)
-- SELECT CAST({
-- type: 'Feature',
-- geometry: ST_AsGeoJSON(ST_Point(1, 2)),
-- properties: {
-- name: 'my_point'
-- }
-- } AS JSON);
-- {"type":"Feature","geometry":{"type":"Point","coordinates":[1.0, 2.0]},"properties":{"name":"my_point"}}
Returns the geometry as a HEXWKB string.
ST_AsHEXWKB(geom)ST_AsHEXWKB(geom)
geom |
|
VARCHAR
The spatial extension (LOAD spatial;).
SELECT ST_AsHexWKB('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::GEOMETRY);
-- 01030000000100000005000000000000000000000000000...
Make a Mapbox Vector Tile from a set of geometries and properties The function takes as input a row type (STRUCT) containing a geometry column and any number of property columns. It returns a single binary BLOB containing the Mapbox Vector Tile.
The function has the following signature:
ST_AsMVT(row STRUCT, layer_name VARCHAR DEFAULT 'layer', extent INTEGER DEFAULT 4096, geom_column_name VARCHAR DEFAULT NULL, feature_id_column_name VARCHAR DEFAULT NULL) -> BLOB
The first argument is a struct containing the geometry and properties.
The second argument is the name of the layer in the vector tile. This argument is optional and defaults to 'layer'.
The third argument is the extent of the tile. This argument is optional and defaults to 4096.
The fourth argument is the name of the geometry column in the input row. This argument is optional. If not provided, the first geometry column in the input row will be used. If multiple geometry columns are present, an error will be raised.
The fifth argument is the name of the feature id column in the input row. This argument is optional. If provided, the values in this column will be used as feature ids in the vector tile. The column must be of type INTEGER or BIGINT. If set to negative or NULL, a feature id will not be assigned to the corresponding feature.
The input struct must contain exactly one geometry column of type GEOMETRY. It can contain any number of property columns of types VARCHAR, FLOAT, DOUBLE, INTEGER, BIGINT, or BOOLEAN.
Example:
SELECT ST_AsMVT({'geom': geom, 'id': id, 'name': name}, 'cities', 4096, 'geom', 'id') AS tile
FROM cities;
This example creates a vector tile named 'cities' with an extent of 4096 from the 'cities' table, using 'geom' as the geometry column and 'id' as the feature id column.
However, you probably want to use the ST_AsMVTGeom function to first transform and clip your geometries to the tile extent.
The following example assumes the geometry is in WebMercator ("EPSG:3857") coordinates.
Replace {z}, {x}, and {y} with the appropriate tile coordinates, {your table} with your table name, and {tile_path} with the path to write the tile to.
COPY (
SELECT ST_AsMVT({{
"geometry": ST_AsMVTGeom(
geometry,
ST_Extent(ST_TileEnvelope({z}, {x}, {y})),
4096,
256,
false
)
}})
FROM {your table} WHERE ST_Intersects(geometry, ST_TileEnvelope({z}, {x}, {y}))
) to {tile_path} (FORMAT 'BLOB');
```.
ST_AsMVT(col0, col1, col2, col3, col4)ST_AsMVT(col0, col1, col2, col3, col4)
col0 |
|
col1 |
|
col2 |
|
col3 |
|
col4 |
|
BLOB
ST_AsMVT(col0 = ANY)
ST_AsMVT(col0 = ANY, col1 = VARCHAR)
ST_AsMVT(col0 = ANY, col1 = VARCHAR, col2 = INTEGER)
ST_AsMVT(col0 = ANY, col1 = VARCHAR, col2 = INTEGER, col3 = VARCHAR)
ST_AsMVT(col0 = ANY, col1 = VARCHAR, col2 = INTEGER, col3 = VARCHAR, col4 = VARCHAR)
The spatial extension (LOAD spatial;).
Transform and clip geometry to a tile boundary
See "ST_AsMVT" for more details.
ST_AsMVTGeom(geom, bounds, extent, buffer, clip_geom)ST_AsMVTGeom(geom, bounds, extent, buffer, clip_geom)
geom |
|
bounds |
|
extent |
|
buffer |
|
clip_geom |
|
GEOMETRY
ST_AsMVTGeom(geom = GEOMETRY, bounds = BOX_2D, extent = BIGINT, buffer = BIGINT, clip_geom = BOOLEAN)
ST_AsMVTGeom(geom = GEOMETRY, bounds = BOX_2D, extent = BIGINT, buffer = BIGINT)
ST_AsMVTGeom(geom = GEOMETRY, bounds = BOX_2D, extent = BIGINT)
ST_AsMVTGeom(geom = GEOMETRY, bounds = BOX_2D)
The spatial extension (LOAD spatial;).
Convert the geometry into a SVG fragment or path
The SVG fragment is returned as a string. The fragment is a path element that can be used in an SVG document. The second boolean argument specifies whether the path should be relative or absolute. The third argument specifies the maximum number of digits to use for the coordinates.
Points are formatted as cx/cy using absolute coordinates or x/y using relative coordinates.
ST_AsSVG(geom, relative, precision)ST_AsSVG(geom, relative, precision)
geom |
|
relative |
|
precision |
|
VARCHAR
The spatial extension (LOAD spatial;).
SELECT ST_AsSVG('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::GEOMETRY, false, 15);
-- M 0 0 L 0 -1 1 -1 1 0 Z
st_astext(geom = GEOMETRY): Returns the Well-Known Text (WKT) representation of the geometry.
st_astext(point = POINT_2D), st_astext(linestring = LINESTRING_2D), st_astext(polygon = POLYGON_2D), st_astext(box = BOX_2D): Returns the geometry as a WKT string.
st_astext(geom)st_astext(geom)
geom |
|
VARCHAR
st_astext(geom = GEOMETRY)
st_astext(point = POINT_2D)
st_astext(linestring = LINESTRING_2D)
st_astext(polygon = POLYGON_2D)
st_astext(box = BOX_2D)
st_astext(geom = GEOMETRY): built in
st_astext(point = POINT_2D): spatial
st_astext(linestring = LINESTRING_2D): spatial
st_astext(polygon = POLYGON_2D): spatial
st_astext(box = BOX_2D): spatial
ST_AsText(ST_GeomFromWKB(X'01010000000000000000000000000000000000000000000000')) SELECT ST_MakeEnvelope(0, 0, 1, 1); -- POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))
Other geometry:
st_aswkb(),
st_crs(),
st_geomfromwkb()
Returns the Well-Known Binary (WKB) representation of the geometry.
st_aswkb(geom)st_aswkb(geom)
geom |
|
BLOB
st_aswkb(ST_GeomFromWKB(X'01010000000000000000000000000000000000000000000000000'))
Other geometry:
st_astext(),
st_crs(),
st_geomfromwkb()
Returns the azimuth (a clockwise angle measured from north) of two points in radian.
ST_Azimuth(origin, target)ST_Azimuth(origin, target)
origin, target
|
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT degrees(ST_Azimuth(ST_Point(0, 0), ST_Point(0, 1))); -- 90.0
Returns the "boundary" of a geometry.
ST_Boundary(geom)ST_Boundary(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns a buffer around the input geometry at the target distance
geom is the input geometry.
distance is the target distance for the buffer, using the same units as the input geometry.
num_triangles represents how many triangles that will be produced to approximate a quarter circle. The larger the number, the smoother the resulting geometry. The default value is 8.
cap_style must be one of "CAP_ROUND", "CAP_FLAT", "CAP_SQUARE". This parameter is case-insensitive.
join_style must be one of "JOIN_ROUND", "JOIN_MITRE", "JOIN_BEVEL". This parameter is case-insensitive.
mitre_limit only applies when join_style is "JOIN_MITRE". It is the ratio of the distance from the corner to the mitre point to the corner radius. The default value is 1.0.
This is a planar operation and will not take into account the curvature of the earth.
ST_Buffer(geom, distance, num_triangles, cap_style, join_style, mitre_limit)ST_Buffer(geom, distance, num_triangles, cap_style, join_style, mitre_limit)
geom |
|
distance |
|
num_triangles |
|
cap_style |
|
join_style |
|
mitre_limit |
|
GEOMETRY
ST_Buffer(geom = GEOMETRY, distance = DOUBLE)
ST_Buffer(geom = GEOMETRY, distance = DOUBLE, num_triangles = INTEGER)
ST_Buffer(geom = GEOMETRY, distance = DOUBLE, num_triangles = INTEGER, cap_style = VARCHAR, join_style = VARCHAR, mitre_limit = DOUBLE)
The spatial extension (LOAD spatial;).
Creates a polygonal geometry by attempting to "fill in" the input geometry.
Unlike ST_Polygonize, this function does not fill in holes.
ST_BuildArea(geom)ST_BuildArea(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the centroid of a geometry.
ST_Centroid(box)ST_Centroid(box)
box |
|
GEOMETRY | POINT_2D
ST_Centroid(geom = GEOMETRY)
ST_Centroid(point = POINT_2D)
ST_Centroid(linestring = LINESTRING_2D)
ST_Centroid(polygon = POLYGON_2D)
ST_Centroid(box = BOX_2D)
ST_Centroid(box = BOX_2DF)
The spatial extension (LOAD spatial;).
Returns the closest point on the first geometry to the second geometry.
ST_ClosestPoint(geom1, geom2)ST_ClosestPoint(geom1, geom2)
geom1, geom2
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
Collects a list of geometries into a collection geometry.
If all geometries are POINT's, a MULTIPOINT is returned.
If all geometries are LINESTRING's, a MULTILINESTRING is returned.
If all geometries are POLYGON's, a MULTIPOLYGON is returned.
Otherwise if the input collection contains a mix of geometry types, a GEOMETRYCOLLECTION is returned.
Empty and NULL geometries are ignored. If all geometries are empty or NULL, a GEOMETRYCOLLECTION EMPTY is returned.
ST_Collect(geoms)ST_Collect(geoms)
geoms |
|
GEOMETRY
The spatial extension (LOAD spatial;).
-- With all POINT's, a MULTIPOINT is returned
SELECT ST_Collect([ST_Point(1, 2), ST_Point(3, 4)]);
-- MULTIPOINT (1 2, 3 4)
--
-- -- With mixed geometry types, a GEOMETRYCOLLECTION is returned
-- SELECT ST_Collect([ST_Point(1, 2), ST_GeomFromText('LINESTRING(3 4, 5 6)')]);
-- GEOMETRYCOLLECTION (POINT (1 2), LINESTRING (3 4, 5 6))
--
-- -- Note that the empty geometry is ignored, so the result is a MULTIPOINT
-- SELECT ST_Collect([ST_Point(1, 2), NULL, ST_GeomFromText('GEOMETRYCOLLECTION EMPTY')]);
-- MULTIPOINT (1 2)
--
-- -- If all geometries are empty or NULL, a GEOMETRYCOLLECTION EMPTY is returned
-- SELECT ST_Collect([NULL, ST_GeomFromText('GEOMETRYCOLLECTION EMPTY')]);
-- GEOMETRYCOLLECTION EMPTY
--
-- -- Tip: You can use the `ST_Collect` function together with the `list()` aggregate function to collect multiple rows of geometries into a single geometry collection:
--
-- CREATE TABLE points (geom GEOMETRY);
--
-- INSERT INTO points VALUES (ST_Point(1, 2)), (ST_Point(3, 4));
--
-- SELECT ST_Collect(list(geom)) FROM points;
-- MULTIPOINT (1 2, 3 4)
Extracts geometries from a GeometryCollection into a typed multi geometry.
If the input geometry is a GeometryCollection, the function will return a multi geometry, determined by the type parameter.
if type = 1, returns a MultiPoint containing all the Points in the collection
if type = 2, returns a MultiLineString containing all the LineStrings in the collection
if type = 3, returns a MultiPolygon containing all the Polygons in the collection
If no type parameters is provided, the function will return a multi geometry matching the highest "surface dimension"
of the contained geometries. E.g. if the collection contains only Points, a MultiPoint will be returned. But if the
collection contains both Points and LineStrings, a MultiLineString will be returned. Similarly, if the collection
contains Polygons, a MultiPolygon will be returned. Contained geometries of a lower surface dimension will be ignored.
If the input geometry contains nested GeometryCollections, their geometries will be extracted recursively and included into the final multi geometry as well.
If the input geometry is not a GeometryCollection, the function will return the input geometry as is.
ST_CollectionExtract(geom, type)ST_CollectionExtract(geom, type)
geom |
|
type |
|
GEOMETRY
ST_CollectionExtract(geom = GEOMETRY, type = INTEGER)
ST_CollectionExtract(geom = GEOMETRY)
The spatial extension (LOAD spatial;).
SELECT ST_CollectionExtract('MULTIPOINT(1 2, 3 4)'::GEOMETRY, 1);
-- MULTIPOINT (1 2, 3 4)
Returns the 'concave' hull of the input geometry, containing all of the source input's points, and which can be used to create polygons from points. The ratio parameter dictates the level of concavity; 1.0 returns the convex hull; and 0 indicates to return the most concave hull possible. Set allowHoles to a non-zero value to allow output containing holes.
ST_ConcaveHull(geom, ratio, allowHoles)ST_ConcaveHull(geom, ratio, allowHoles)
geom |
|
ratio |
|
allowHoles |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns true if the first geometry contains the second geometry
In contrast to ST_ContainsProperly, this function will also return true if geom2 is contained strictly on the boundary of geom1.
A geometry always ST_Contains itself, but does not ST_ContainsProperly itself.
ST_Contains(geom1, geom2)ST_Contains(geom1, geom2)
geom1 |
|
geom2 |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if the first geometry \"properly\" contains the second geometry
In contrast to ST_Contains, this function does not return true if geom2 is contained strictly on the boundary of geom1.
A geometry always ST_Contains itself, but does not ST_ContainsProperly itself.
ST_ContainsProperly(geom1, geom2)ST_ContainsProperly(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the convex hull enclosing the geometry.
ST_ConvexHull(geom)ST_ConvexHull(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Aligns the edges of a list of polygons whose edges are meant to align but are in fact exact matches.
Returns a collection of fixed polygons with the same size and order as the input polygons. EMPTY will be used in place of collapsed polygons.
ST_CoverageClean(geoms, snapping_distance, gap_maximum_width)ST_CoverageClean(geoms, snapping_distance, gap_maximum_width)
geoms |
|
snapping_distance |
|
gap_maximum_width |
|
GEOMETRY
ST_CoverageClean(geoms = `GEOMETRY[]`, snapping_distance = DOUBLE, gap_maximum_width = DOUBLE)
ST_CoverageClean(geoms = `GEOMETRY[]`, snapping_distance = DOUBLE)
ST_CoverageClean(geoms = `GEOMETRY[]`)
The spatial extension (LOAD spatial;).
Returns the invalid edges in a polygonal coverage, which are edges that are not shared by two polygons. Returns NULL if the input is not a polygonal coverage, or if the input is valid. Tolerance is 0 by default.
ST_CoverageInvalidEdges(geoms, tolerance)ST_CoverageInvalidEdges(geoms, tolerance)
geoms |
|
tolerance |
|
GEOMETRY
ST_CoverageInvalidEdges(geoms = `GEOMETRY[]`, tolerance = DOUBLE)
ST_CoverageInvalidEdges(geoms = `GEOMETRY[]`)
The spatial extension (LOAD spatial;).
Returns the invalid edges of a coverage geometry.
ST_CoverageInvalidEdges_Agg(col0, col1)ST_CoverageInvalidEdges_Agg(col0, col1)
col0 |
|
col1 |
|
GEOMETRY
ST_CoverageInvalidEdges_Agg(col0 = GEOMETRY)
ST_CoverageInvalidEdges_Agg(col0 = GEOMETRY, col1 = DOUBLE)
The spatial extension (LOAD spatial;).
Simplify the edges in a polygonal coverage, preserving the coverange by ensuring that the there are no seams between the resulting simplified polygons.
By default, the boundary of the coverage is also simplified, but this can be controlled with the optional third 'simplify_boundary' parameter.
ST_CoverageSimplify(geoms, tolerance, simplify_boundary)ST_CoverageSimplify(geoms, tolerance, simplify_boundary)
geoms |
|
tolerance |
|
simplify_boundary |
|
GEOMETRY
ST_CoverageSimplify(geoms = `GEOMETRY[]`, tolerance = DOUBLE, simplify_boundary = BOOLEAN)
ST_CoverageSimplify(geoms = `GEOMETRY[]`, tolerance = DOUBLE)
The spatial extension (LOAD spatial;).
Simplifies a set of geometries while maintaining coverage.
ST_CoverageSimplify_Agg(col0, col1, col2)ST_CoverageSimplify_Agg(col0, col1, col2)
col0 |
|
col1 |
|
col2 |
|
GEOMETRY
ST_CoverageSimplify_Agg(col0 = GEOMETRY, col1 = DOUBLE)
ST_CoverageSimplify_Agg(col0 = GEOMETRY, col1 = DOUBLE, col2 = BOOLEAN)
The spatial extension (LOAD spatial;).
Union all geometries in a polygonal coverage into a single geometry.
This may be faster than using ST_Union, but may use more memory.
ST_CoverageUnion(geoms)ST_CoverageUnion(geoms)
geoms |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Unions a set of geometries while maintaining coverage.
ST_CoverageUnion_Agg(col0)ST_CoverageUnion_Agg(col0)
col0 |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns true if geom1 is "covered by" geom2.
ST_CoveredBy(geom1, geom2)ST_CoveredBy(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if the geom1 "covers" geom2.
ST_Covers(geom1, geom2)ST_Covers(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if geom1 "crosses" geom2.
ST_Crosses(geom1, geom2)ST_Crosses(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the Coordinate Reference System (CRS) identifier of the geometry.
st_crs(geom)st_crs(geom)
geom |
|
VARCHAR
Other geometry:
st_astext(),
st_aswkb(),
st_geomfromwkb()
Returns the "difference" between two geometries.
ST_Difference(geom1, geom2)ST_Difference(geom1, geom2)
geom1, geom2
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the "topological dimension" of a geometry.
For POINT and MULTIPOINT geometries, returns 0
For LINESTRING and MULTILINESTRING, returns 1
For POLYGON and MULTIPOLYGON, returns 2
For GEOMETRYCOLLECTION, returns the maximum dimension of the contained geometries, or 0 if the collection is empty.
ST_Dimension(geom)ST_Dimension(geom)
geom |
|
INTEGER
The spatial extension (LOAD spatial;).
SELECT ST_Dimension('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'::GEOMETRY);
-- 2
Returns true if the geometries are disjoint.
ST_Disjoint(geom1, geom2)ST_Disjoint(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the planar distance between two geometries.
ST_Distance(point1, point2)ST_Distance(point1, point2)
point1, point2
|
|
DOUBLE
ST_Distance(point1 = POINT_2D, point2 = POINT_2D)
ST_Distance(point = POINT_2D, linestring = LINESTRING_2D)
ST_Distance(linestring = LINESTRING_2D, point = POINT_2D)
ST_Distance(geom1 = GEOMETRY, geom2 = GEOMETRY)
The spatial extension (LOAD spatial;).
SELECT ST_Distance('POINT (0 0)'::GEOMETRY, 'POINT (3 4)'::GEOMETRY);
-- 5.0
--
-- -- Z coordinates are ignored
-- SELECT ST_Distance('POINT Z (0 0 0)'::GEOMETRY, 'POINT Z (3 4 5)'::GEOMETRY);
-- 5.0
Returns the planar distance between two geometries.
ST_Distance_GEOS(geom1, geom2)ST_Distance_GEOS(geom1, geom2)
geom1, geom2
|
|
DOUBLE
The spatial extension (LOAD spatial;).
Returns the haversine (great circle) distance between two geometries.
Only supports POINT geometries.
Returns the distance in meters.
The input is expected to be in WGS84 (EPSG:4326) coordinates, using a [latitude, longitude] axis order.
ST_Distance_Sphere(geom1, geom2)ST_Distance_Sphere(geom1, geom2)
geom1, geom2
|
|
DOUBLE
ST_Distance_Sphere(geom1 = GEOMETRY, geom2 = GEOMETRY)
ST_Distance_Sphere(point1 = POINT_2D, point2 = POINT_2D)
The spatial extension (LOAD spatial;).
Returns the distance between two geometries in meters using an ellipsoidal model of the earths surface
The input geometry is assumed to be in the EPSG:4326 coordinate system (WGS84), with [latitude, longitude] axis order and the distance limit is expected to be in meters. This function uses the GeographicLib library to solve the inverse geodesic problem, calculating the distance between two points using an ellipsoidal model of the earth. This is a highly accurate method for calculating the distance between two arbitrary points taking the curvature of the earths surface into account, but is also the slowest.
ST_Distance_Spheroid(p1, p2)ST_Distance_Spheroid(p1, p2)
p1, p2
|
|
DOUBLE
The spatial extension (LOAD spatial;).
-- Note: the coordinates are in WGS84 and [latitude, longitude] axis order -- Whats the distance between New York and Amsterdam (JFK and AMS airport)? SELECT st_distance_spheroid( st_point(40.6446, -73.7797), st_point(52.3130, 4.7725) ); -- 5863418.7459356235 -- -- Roughly 5863km!
Returns the list of supported GDAL drivers and file formats
Note that far from all of these drivers have been tested properly. Some may require additional options to be passed to work as expected. If you run into any issues please first consult the consult the GDAL docs.
ST_Drivers()ST_Drivers()
Unspecified.
The spatial extension (LOAD spatial;).
SELECT * FROM ST_Drivers();
Dumps a geometry into a list of sub-geometries and their "path" in the original geometry.
You can use the unnest(res, recursive := true) function to explode the resulting list of structs into multiple rows.
ST_Dump(geom)ST_Dump(geom)
geom |
|
STRUCT(geom GEOMETRY, path INTEGER[])[]
The spatial extension (LOAD spatial;).
SELECT ST_Dump('MULTIPOINT(1 2, 3 4)'::GEOMETRY);
-- [{'geom': 'POINT(1 2)', 'path': [0]}, {'geom': 'POINT(3 4)', 'path': [1]}]
--
-- SELECT unnest(ST_Dump('MULTIPOINT(1 2, 3 4)'::GEOMETRY), recursive := true);
-- -- +-------------+---------+
-- -- | geom | path |
-- -- | geometry | int32[] |
-- -- +-------------+---------+
-- -- | POINT (1 2) | [1] |
-- -- | POINT (3 4) | [2] |
-- -- +-------------+---------+
Returns if two geometries are within a target distance of each-other.
ST_DWithin(geom1, geom2, distance)ST_DWithin(geom1, geom2, distance)
geom1 |
|
geom2 |
|
distance |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if two geometries are within a target distance of each-other.
ST_DWithin_GEOS(geom1, geom2, distance)ST_DWithin_GEOS(geom1, geom2, distance)
geom1 |
|
geom2 |
|
distance |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns if two POINT_2D's are within a target distance in meters, using an ellipsoidal model of the earths surface
The input geometry is assumed to be in the EPSG:4326 coordinate system (WGS84), with [latitude, longitude] axis order and the distance is returned in meters. This function uses the GeographicLib library to solve the inverse geodesic problem, calculating the distance between two points using an ellipsoidal model of the earth. This is a highly accurate method for calculating the distance between two arbitrary points taking the curvature of the earths surface into account, but is also the slowest.
ST_DWithin_Spheroid(p1, p2, distance)ST_DWithin_Spheroid(p1, p2, distance)
p1 |
|
p2 |
|
distance |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the end point of a LINESTRING.
ST_EndPoint(geom)ST_EndPoint(geom)
geom |
|
GEOMETRY | POINT_2D
ST_EndPoint(geom = GEOMETRY)
ST_EndPoint(line = LINESTRING_2D)
The spatial extension (LOAD spatial;).
Returns the minimum bounding rectangle of a geometry as a polygon geometry.
ST_Envelope(geom)ST_Envelope(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Alias for ST_Extent_Agg.
Computes the minimal-bounding-box polygon containing the set of input geometries.
ST_Envelope_Agg(col0)ST_Envelope_Agg(col0)
col0 |
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_Extent_Agg(geom) FROM UNNEST([ST_Point(1,1), ST_Point(5,5)]) AS _(geom); -- POLYGON ((1 1, 1 5, 5 5, 5 1, 1 1))
Returns true if the geometries are "equal".
ST_Equals(geom1, geom2)ST_Equals(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Expand the input geometry by the specified distance, returning a polygon.
geom is the input geometry.
distance is the target distance for the expansion, using the same units as the input geometry.
This is a planar operation and will not take into account the curvature of the earth.
ST_Expand(geom, distance)ST_Expand(geom, distance)
geom |
|
distance |
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_AsText(ST_Expand(ST_GeomFromText('POINT(20 30)'), 0.1));
Returns the minimal bounding box enclosing the input geometry.
ST_Extent(geom)ST_Extent(geom)
geom |
|
BOX_2D
The spatial extension (LOAD spatial;).
Computes the minimal-bounding-box polygon containing the set of input geometries.
ST_Extent_Agg(col0)ST_Extent_Agg(col0)
col0 |
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_Extent_Agg(geom) FROM UNNEST([ST_Point(1,1), ST_Point(5,5)]) AS _(geom); -- POLYGON ((1 1, 1 5, 5 5, 5 1, 1 1))
Returns the approximate bounding box of a geometry, if available.
This function is only really used internally, and returns the cached bounding box of the geometry if it exists. This function may be removed or renamed in the future.
ST_Extent_Approx(geom)ST_Extent_Approx(geom)
geom |
|
BOX_2DF
The spatial extension (LOAD spatial;).
Returns the exterior ring (shell) of a polygon geometry.
ST_ExteriorRing(geom)ST_ExteriorRing(geom)
geom |
|
GEOMETRY | LINESTRING_2D
ST_ExteriorRing(geom = GEOMETRY)
ST_ExteriorRing(polygon = POLYGON_2D)
The spatial extension (LOAD spatial;).
Returns a new geometry with the coordinates of the input geometry "flipped" so that x = y and y = x.
ST_FlipCoordinates(geom)ST_FlipCoordinates(geom)
geom |
|
GEOMETRY | POINT_2D | LINESTRING_2D | POLYGON_2D | BOX_2D
ST_FlipCoordinates(geom = GEOMETRY)
ST_FlipCoordinates(point = POINT_2D)
ST_FlipCoordinates(linestring = LINESTRING_2D)
ST_FlipCoordinates(polygon = POLYGON_2D)
ST_FlipCoordinates(box = BOX_2D)
The spatial extension (LOAD spatial;).
Forces the vertices of a geometry to have X and Y components
This function will drop any Z and M values from the input geometry, if present. If the input geometry is already 2D, it will be returned as is.
ST_Force2D(geom)ST_Force2D(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Forces the vertices of a geometry to have X, Y and M components
The following cases apply:
If the input geometry has a Z component but no M component, the Z component will be replaced with the new M value.
If the input geometry has a M component but no Z component, it will be returned as is.
If the input geometry has both a Z component and a M component, the Z component will be removed.
Otherwise, if the input geometry has neither a Z or M component, the new M value will be added to the vertices of the input geometry.
ST_Force3DM(geom, m)ST_Force3DM(geom, m)
geom |
|
m |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Forces the vertices of a geometry to have X, Y and Z components
The following cases apply:
If the input geometry has a M component but no Z component, the M component will be replaced with the new Z value.
If the input geometry has a Z component but no M component, it will be returned as is.
If the input geometry has both a Z component and a M component, the M component will be removed.
Otherwise, if the input geometry has neither a Z or M component, the new Z value will be added to the vertices of the input geometry.
ST_Force3DZ(geom, z)ST_Force3DZ(geom, z)
geom |
|
z |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Forces the vertices of a geometry to have X, Y, Z and M components
The following cases apply:
If the input geometry has a Z component but no M component, the new M value will be added to the vertices of the input geometry.
If the input geometry has a M component but no Z component, the new Z value will be added to the vertices of the input geometry.
If the input geometry has both a Z component and a M component, the geometry will be returned as is.
Otherwise, if the input geometry has neither a Z or M component, the new Z and M values will be added to the vertices of the input geometry.
ST_Force4D(geom, z, m)ST_Force4D(geom, z, m)
geom |
|
z |
|
m |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Generates a set of random points within the specified bounding box.
Takes a bounding box (min_x, min_y, max_x, max_y), a count of points to generate, and optionally a seed for the random number generator.
ST_GeneratePoints(col0, col1, col2)ST_GeneratePoints(col0, col1, col2)
col0 |
|
col1 |
|
col2 |
|
Unspecified.
ST_GeneratePoints(col0 = BOX_2D, col1 = BIGINT)
ST_GeneratePoints(col0 = BOX_2D, col1 = BIGINT, col2 = BIGINT)
The spatial extension (LOAD spatial;).
SELECT * FROM ST_GeneratePoints({min_x: 0, min_y:0, max_x:10, max_y:10}::BOX_2D, 5, 42);
Returns a 'GEOMETRY_TYPE' enum identifying the input geometry type. Possible enum return types are: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION.
ST_GeometryType(geom)ST_GeometryType(geom)
geom |
|
ANY
ST_GeometryType(geom = GEOMETRY)
ST_GeometryType(point = POINT_2D)
ST_GeometryType(linestring = LINESTRING_2D)
ST_GeometryType(polygon = POLYGON_2D)
The spatial extension (LOAD spatial;).
SELECT DISTINCT ST_GeometryType(ST_GeomFromText('POINT(1 1)'));
-- POINT
Deserializes a GEOMETRY from a GeoJSON fragment.
ST_GeomFromGeoJSON(geojson)ST_GeomFromGeoJSON(geojson)
geojson |
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_GeomFromGeoJSON('{"type": "Point", "coordinates": [1.0, 2.0]}');
-- POINT (1 2)
Deserialize a GEOMETRY from a HEX(E)WKB encoded string
DuckDB spatial doesn't currently differentiate between WKB and EWKB, so ST_GeomFromHEXWKB and ST_GeomFromHEXEWKB are just aliases of each other.
ST_GeomFromHEXEWKB(hexwkb)ST_GeomFromHEXEWKB(hexwkb)
hexwkb |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Deserialize a GEOMETRY from a HEX(E)WKB encoded string
DuckDB spatial doesn't currently differentiate between WKB and EWKB, so ST_GeomFromHEXWKB and ST_GeomFromHEXEWKB are just aliases of each other.
ST_GeomFromHEXWKB(hexwkb)ST_GeomFromHEXWKB(hexwkb)
hexwkb |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Deserialize a GEOMETRY from a WKT encoded string.
ST_GeomFromText(wkt, ignore_invalid)ST_GeomFromText(wkt, ignore_invalid)
wkt |
|
ignore_invalid |
|
GEOMETRY
ST_GeomFromText(wkt = VARCHAR)
ST_GeomFromText(wkt = VARCHAR, ignore_invalid = BOOLEAN)
The spatial extension (LOAD spatial;).
Creates a geometry from Well-Known Binary (WKB) representation.
st_geomfromwkb(wkb)st_geomfromwkb(wkb)
wkb |
|
GEOMETRY
ST_GeomFromWKB(X'01010000000000000000000000000000000000000000000000')
Other geometry:
st_astext(),
st_aswkb(),
st_crs()
Check if the input geometry has M values.
ST_HasM(geom)ST_HasM(geom)
geom |
|
BOOLEAN
The spatial extension (LOAD spatial;).
-- HasM for a 2D geometry
SELECT ST_HasM(ST_GeomFromText('POINT(1 1)'));
-- false
--
-- -- HasM for a 3DZ geometry
-- SELECT ST_HasM(ST_GeomFromText('POINT Z(1 1 1)'));
-- false
--
-- -- HasM for a 3DM geometry
-- SELECT ST_HasM(ST_GeomFromText('POINT M(1 1 1)'));
-- true
--
-- -- HasM for a 4D geometry
-- SELECT ST_HasM(ST_GeomFromText('POINT ZM(1 1 1 1)'));
-- true
Check if the input geometry has Z values.
ST_HasZ(geom)ST_HasZ(geom)
geom |
|
BOOLEAN
The spatial extension (LOAD spatial;).
-- HasZ for a 2D geometry
SELECT ST_HasZ(ST_GeomFromText('POINT(1 1)'));
-- false
--
-- -- HasZ for a 3DZ geometry
-- SELECT ST_HasZ(ST_GeomFromText('POINT Z(1 1 1)'));
-- true
--
-- -- HasZ for a 3DM geometry
-- SELECT ST_HasZ(ST_GeomFromText('POINT M(1 1 1)'));
-- false
--
-- -- HasZ for a 4D geometry
-- SELECT ST_HasZ(ST_GeomFromText('POINT ZM(1 1 1 1)'));
-- true
Encodes the X and Y values as the hilbert curve index for a curve covering the given bounding box. If a geometry is provided, the center of the approximate bounding box is used as the point to encode. If no bounding box is provided, the hilbert curve index is mapped to the full range of a single-precision float. For the BOX_2D and BOX_2DF variants, the center of the box is used as the point to encode.
ST_Hilbert(box, bounds)ST_Hilbert(box, bounds)
box, bounds
|
|
UINTEGER
ST_Hilbert(x = DOUBLE, y = DOUBLE, bounds = BOX_2D)
ST_Hilbert(geom = GEOMETRY, bounds = BOX_2D)
ST_Hilbert(geom = GEOMETRY)
ST_Hilbert(box = BOX_2D, bounds = BOX_2D)
ST_Hilbert(box = BOX_2DF, bounds = BOX_2DF)
The spatial extension (LOAD spatial;).
Returns the N-th interior ring (hole) of a POLYGON as a LINESTRING. Indexing is 1-based (n = 1 returns the first interior ring). Returns NULL if the polygon is empty or has fewer than N interior rings.
ST_InteriorRingN(geom, n)ST_InteriorRingN(geom, n)
geom |
|
n |
|
GEOMETRY | LINESTRING_2D
ST_InteriorRingN(geom = GEOMETRY, n = BIGINT)
ST_InteriorRingN(polygon = POLYGON_2D, n = BIGINT)
The spatial extension (LOAD spatial;).
SELECT ST_AsText(ST_InteriorRingN(ST_GeomFromText('POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,4 2,4 4,2 4,2 2))'), 1));
Computes the closest point on a LINESTRING to a given POINT and returns the interpolated M value of that point.
First argument must be a linestring and must have a M dimension. The second argument must be a point. Neither argument can be empty.
ST_InterpolatePoint(line, point)ST_InterpolatePoint(line, point)
line, point
|
|
DOUBLE
The spatial extension (LOAD spatial;).
Returns the intersection of two geometries.
ST_Intersection(geom1, geom2)ST_Intersection(geom1, geom2)
geom1, geom2
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
Computes the intersection of a set of geometries.
ST_Intersection_Agg(col0)ST_Intersection_Agg(col0)
col0 |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns true if the geometries intersect.
ST_Intersects(box1, box2)ST_Intersects(box1, box2)
box1, box2
|
|
BOOLEAN
ST_Intersects(box1 = BOX_2D, box2 = BOX_2D)
ST_Intersects(geom1 = GEOMETRY, geom2 = GEOMETRY)
The spatial extension (LOAD spatial;).
Check if a geometry is 'closed'.
ST_IsClosed(geom)ST_IsClosed(geom)
geom |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if the geometry is "empty".
ST_IsEmpty(geom)ST_IsEmpty(geom)
geom |
|
BOOLEAN
ST_IsEmpty(geom = GEOMETRY)
ST_IsEmpty(linestring = LINESTRING_2D)
ST_IsEmpty(polygon = POLYGON_2D)
The spatial extension (LOAD spatial;).
Returns true if the geometry is a ring (both ST_IsClosed and ST_IsSimple).
ST_IsRing(geom)ST_IsRing(geom)
geom |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if the geometry is simple.
ST_IsSimple(geom)ST_IsSimple(geom)
geom |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if the geometry is valid.
ST_IsValid(geom)ST_IsValid(geom)
geom |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the length of the input line geometry.
ST_Length(geom)ST_Length(geom)
geom |
|
DOUBLE
ST_Length(geom = GEOMETRY)
ST_Length(linestring = LINESTRING_2D)
The spatial extension (LOAD spatial;).
Returns the length of the input geometry in meters, using an ellipsoidal model of the earth
The input geometry is assumed to be in the EPSG:4326 coordinate system (WGS84), with [latitude, longitude] axis order and the length is returned in meters. This function uses the GeographicLib library, calculating the length using an ellipsoidal model of the earth. This is a highly accurate method for calculating the length of a line geometry taking the curvature of the earth into account, but is also the slowest.
Returns 0.0 for any geometry that is not a LINESTRING, MULTILINESTRING or GEOMETRYCOLLECTION containing line geometries.
ST_Length_Spheroid(geom)ST_Length_Spheroid(geom)
geom |
|
DOUBLE
ST_Length_Spheroid(geom = GEOMETRY)
ST_Length_Spheroid(line = LINESTRING_2D)
The spatial extension (LOAD spatial;).
Returns a point interpolated along a line at a fraction of total 2D length.
ST_LineInterpolatePoint(line, fraction)ST_LineInterpolatePoint(line, fraction)
line |
|
fraction |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns a multi-point interpolated along a line at a fraction of total 2D length.
if repeat is false, the result is a single point, (and equivalent to ST_LineInterpolatePoint), otherwise, the result is a multi-point with points repeated at the fraction interval.
ST_LineInterpolatePoints(line, fraction, repeat.)ST_LineInterpolatePoints(line, fraction, repeat.)
line |
|
fraction |
|
repeat. |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the location on a line closest to a point as a fraction of the total 2D length of the line.
ST_LineLocatePoint(line, point)ST_LineLocatePoint(line, point)
line, point
|
|
DOUBLE
The spatial extension (LOAD spatial;).
"Merges" the input line geometry, optionally taking direction into account.
ST_LineMerge(geom, preserve_direction)ST_LineMerge(geom, preserve_direction)
geom |
|
preserve_direction |
|
GEOMETRY
ST_LineMerge(geom = GEOMETRY)
ST_LineMerge(geom = GEOMETRY, preserve_direction = BOOLEAN)
The spatial extension (LOAD spatial;).
Deserialize a LINESTRING_2D from a WKB encoded blob.
ST_LineString2DFromWKB(blob)ST_LineString2DFromWKB(blob)
blob |
|
LINESTRING_2D
The spatial extension (LOAD spatial;).
Returns a substring of a line between two fractions of total 2D length.
ST_LineSubstring(line, start_fraction, end_fraction)ST_LineSubstring(line, start_fraction, end_fraction)
line |
|
start_fraction |
|
end_fraction |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns a point or multi-point, containing the point(s) at the geometry with the given measure
For a LINESTRING, or MULTILINESTRING, the location is determined by interpolating between M values For a POINT and MULTIPOINT, the point is returned if the measure matches the M value of the vertex, otherwise an empty geometry is returned For a POLYGON, only the exterior ring is considered, and treated as a LINESTRING
If offset is provided, the resulting point(s) is offset by the given amount perpendicular to the line direction.
ST_LocateAlong(line, measure, offset)ST_LocateAlong(line, measure, offset)
line |
|
measure |
|
offset |
|
GEOMETRY
ST_LocateAlong(line = GEOMETRY, measure = DOUBLE, offset = DOUBLE)
ST_LocateAlong(line = GEOMETRY, measure = DOUBLE)
The spatial extension (LOAD spatial;).
Returns a geometry or geometry collection created by filtering and interpolating vertices within a range of "M" values
Creates a geometry or geometry collection, containing the parts formed by vertices that have an "M" value within the "start_measure" and "end_measure" range
For LINESTRING or MULTILINESTRING, if a line segment would cross either the upper or lower bound, a vertex is added by interpolating the coordinates at the "intersection" For a POINT and MULTIPOINT, the point is added to the collection if its vertex has an "M" value within the range, otherwise it is skipped For a POLYGON, only the exterior ring is considered, and treated like a LINESTRING
If offset is provided, the resulting vertices are offset by the given amount perpendicular to the line direction.
ST_LocateBetween(line, start_measure, end_measure, offset)ST_LocateBetween(line, start_measure, end_measure, offset)
line |
|
start_measure |
|
end_measure |
|
offset |
|
GEOMETRY
ST_LocateBetween(line = GEOMETRY, start_measure = DOUBLE, end_measure = DOUBLE, offset = DOUBLE)
ST_LocateBetween(line = GEOMETRY, start_measure = DOUBLE, end_measure = DOUBLE)
The spatial extension (LOAD spatial;).
Returns the M coordinate of a point geometry.
ST_M(geom)ST_M(geom)
geom |
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT ST_M(ST_Point(1, 2, 3, 4))
Create a BOX2D from two POINT geometries.
ST_MakeBox2D(point1, point2)ST_MakeBox2D(point1, point2)
point1, point2
|
|
BOX_2D
The spatial extension (LOAD spatial;).
SELECT ST_MakeBox2D(ST_Point(0, 0), ST_Point(1, 1)); -- BOX(0 0, 1 1)
Create a rectangular polygon from min/max coordinates.
ST_MakeEnvelope(min_x, min_y, max_x, max_y)ST_MakeEnvelope(min_x, min_y, max_x, max_y)
min_x, min_y, max_x, max_y
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
ST_MakeLine(geoms = `GEOMETRY[]`): Create a LINESTRING from a list of POINT geometries.
ST_MakeLine(start = GEOMETRY, end = GEOMETRY): Create a LINESTRING from two POINT geometries.
ST_MakeLine(start, end)ST_MakeLine(start, end)
start, end
|
|
GEOMETRY
ST_MakeLine(geoms = `GEOMETRY[]`)
ST_MakeLine(start = GEOMETRY, end = GEOMETRY)
The spatial extension (LOAD spatial;).
SELECT ST_MakeLine([ST_Point(0, 0), ST_Point(1, 1)]); -- LINESTRING(0 0, 1 1) SELECT ST_MakeLine(ST_Point(0, 0), ST_Point(1, 1)); -- LINESTRING(0 0, 1 1)
ST_MakePoint(x = DOUBLE, y = DOUBLE): Creates a GEOMETRY point from an pair of floating point numbers.
For geodetic coordinate systems, x is typically the longitude value and y is the latitude value.
Note that ST_Point is equivalent. ST_MakePoint is provided for PostGIS compatibility.
ST_MakePoint(x = DOUBLE, y = DOUBLE, z = DOUBLE): Creates a POINT_3D.
ST_MakePoint(x = DOUBLE, y = DOUBLE, z = DOUBLE, m = DOUBLE): Creates a POINT_4D.
ST_MakePoint(x, y, z, m)ST_MakePoint(x, y, z, m)
x, y, z, m
|
|
POINT_2D | POINT_3D | POINT_4D
ST_MakePoint(x = DOUBLE, y = DOUBLE)
ST_MakePoint(x = DOUBLE, y = DOUBLE, z = DOUBLE)
ST_MakePoint(x = DOUBLE, y = DOUBLE, z = DOUBLE, m = DOUBLE)
The spatial extension (LOAD spatial;).
SELECT ST_AsText(ST_MakePoint(143.3, -24.2)); -- POINT (143.3 -24.2)
ST_MakePolygon(shell = GEOMETRY): Create a POLYGON from a LINESTRING shell.
ST_MakePolygon(shell = GEOMETRY, holes = `GEOMETRY[]`): Create a POLYGON from a LINESTRING shell and a list of LINESTRING holes.
ST_MakePolygon(shell, holes)ST_MakePolygon(shell, holes)
shell |
|
holes |
|
GEOMETRY
ST_MakePolygon(shell = GEOMETRY)
ST_MakePolygon(shell = GEOMETRY, holes = `GEOMETRY[]`)
The spatial extension (LOAD spatial;).
SELECT ST_MakePolygon(ST_LineString([ST_Point(0, 0), ST_Point(1, 0), ST_Point(1, 1), ST_Point(0, 0)])); SELECT ST_MakePolygon(ST_LineString([ST_Point(0, 0), ST_Point(1, 0), ST_Point(1, 1), ST_Point(0, 0)]), [ST_LineString([ST_Point(0.25, 0.25), ST_Point(0.75, 0.25), ST_Point(0.75, 0.75), ST_Point(0.25, 0.25)])]);
Returns a valid representation of the geometry.
ST_MakeValid(geom)ST_MakeValid(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the maximum inscribed circle of the input geometry, optionally with a tolerance.
By default, the tolerance is computed as max(width, height) / 1000.
The return value is a struct with the center of the circle, the nearest point to the center on the boundary of the geometry, and the radius of the circle.
ST_MaximumInscribedCircle(geom, tolerance)ST_MaximumInscribedCircle(geom, tolerance)
geom |
|
tolerance |
|
STRUCT(center GEOMETRY, nearest GEOMETRY, radius DOUBLE)
ST_MaximumInscribedCircle(geom = GEOMETRY)
ST_MaximumInscribedCircle(geom = GEOMETRY, tolerance = DOUBLE)
The spatial extension (LOAD spatial;).
-- Find the maximum inscribed circle of a square
SELECT ST_MaximumInscribedCircle(
ST_GeomFromText('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))')
);
-- {'center': POINT (5 5), 'nearest': POINT (5 0), 'radius': 5.0}
Computes the union of a set of input geometries. "Slower, but might be more memory efficient than ST_UnionAgg as each geometry is merged into the union individually rather than all at once.
ST_MemUnion_Agg(col0)ST_MemUnion_Agg(col0)
col0 |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the minimum rotated rectangle that bounds the input geometry, finding the surrounding box that has the lowest area by using a rotated rectangle, rather than taking the lowest and highest coordinate values as per ST_Envelope().
ST_MinimumRotatedRectangle(geom)ST_MinimumRotatedRectangle(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the maximum M coordinate of a geometry.
ST_MMax(geom)ST_MMax(geom)
geom |
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT ST_MMax(ST_Point(1, 2, 3, 4))
Returns the minimum M coordinate of a geometry.
ST_MMin(geom)ST_MMin(geom)
geom |
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT ST_MMin(ST_Point(1, 2, 3, 4))
Turns a single geometry into a multi geometry.
If the geometry is already a multi geometry, it is returned as is.
ST_Multi(geom)ST_Multi(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_Multi(ST_GeomFromText('POINT(1 2)'));
-- MULTIPOINT (1 2)
--
-- SELECT ST_Multi(ST_GeomFromText('LINESTRING(1 1, 2 2)'));
-- MULTILINESTRING ((1 1, 2 2))
--
-- SELECT ST_Multi(ST_GeomFromText('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'));
-- MULTIPOLYGON (((0 0, 0 1, 1 1, 1 0, 0 0)))
Returns the number of component geometries in a collection geometry. If the input geometry is not a collection, this function returns 0 or 1 depending on if the geometry is empty or not.
ST_NGeometries(geom)ST_NGeometries(geom)
geom |
|
INTEGER
The spatial extension (LOAD spatial;).
Returns the number of interior rings of a polygon.
ST_NInteriorRings(geom)ST_NInteriorRings(geom)
geom |
|
INTEGER
ST_NInteriorRings(geom = GEOMETRY)
ST_NInteriorRings(polygon = POLYGON_2D)
The spatial extension (LOAD spatial;).
Returns a "noded" MultiLinestring, produced by combining a collection of input linestrings and adding additional vertices where they intersect.
ST_Node(geom)ST_Node(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
-- Create a noded multilinestring from two intersecting lines
SELECT ST_Node(
ST_GeomFromText('MULTILINESTRING((0 0, 2 2), (0 2, 2 0))')
);
-- MULTILINESTRING ((0 0, 1 1), (1 1, 2 2), (0 2, 1 1), (1 1, 2 0))
Returns the "normalized" representation of the geometry.
ST_Normalize(geom)ST_Normalize(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the number of vertices within a geometry.
ST_NPoints(geom)ST_NPoints(geom)
geom |
|
UINTEGER | UBIGINT
ST_NPoints(geom = GEOMETRY)
ST_NPoints(point = POINT_2D)
ST_NPoints(linestring = LINESTRING_2D)
ST_NPoints(polygon = POLYGON_2D)
ST_NPoints(box = BOX_2D)
The spatial extension (LOAD spatial;).
Returns the number of component geometries in a collection geometry. If the input geometry is not a collection, this function returns 0 or 1 depending on if the geometry is empty or not.
ST_NumGeometries(geom)ST_NumGeometries(geom)
geom |
|
INTEGER
The spatial extension (LOAD spatial;).
Returns the number of interior rings of a polygon.
ST_NumInteriorRings(geom)ST_NumInteriorRings(geom)
geom |
|
INTEGER
ST_NumInteriorRings(geom = GEOMETRY)
ST_NumInteriorRings(polygon = POLYGON_2D)
The spatial extension (LOAD spatial;).
Returns the number of vertices within a geometry.
ST_NumPoints(geom)ST_NumPoints(geom)
geom |
|
UINTEGER | UBIGINT
ST_NumPoints(geom = GEOMETRY)
ST_NumPoints(point = POINT_2D)
ST_NumPoints(linestring = LINESTRING_2D)
ST_NumPoints(polygon = POLYGON_2D)
ST_NumPoints(box = BOX_2D)
The spatial extension (LOAD spatial;).
Returns true if the geometries overlap.
ST_Overlaps(geom1, geom2)ST_Overlaps(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the length of the perimeter of the geometry.
ST_Perimeter(geom)ST_Perimeter(geom)
geom |
|
DOUBLE
ST_Perimeter(geom = GEOMETRY)
ST_Perimeter(polygon = POLYGON_2D)
ST_Perimeter(box = BOX_2D)
The spatial extension (LOAD spatial;).
Returns the length of the perimeter in meters using an ellipsoidal model of the earths surface
The input geometry is assumed to be in the EPSG:4326 coordinate system (WGS84), with [latitude, longitude] axis order and the length is returned in meters. This function uses the GeographicLib library, calculating the perimeter using an ellipsoidal model of the earth. This is a highly accurate method for calculating the perimeter of a polygon taking the curvature of the earth into account, but is also the slowest.
Returns 0.0 for any geometry that is not a POLYGON, MULTIPOLYGON or GEOMETRYCOLLECTION containing polygon geometries.
ST_Perimeter_Spheroid(geom)ST_Perimeter_Spheroid(geom)
geom |
|
DOUBLE
ST_Perimeter_Spheroid(geom = GEOMETRY)
ST_Perimeter_Spheroid(poly = POLYGON_2D)
The spatial extension (LOAD spatial;).
Creates a GEOMETRY point.
ST_Point(x, y)ST_Point(x, y)
x, y
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
Creates a POINT_2D.
ST_Point2D(x, y)ST_Point2D(x, y)
x, y
|
|
POINT_2D
The spatial extension (LOAD spatial;).
Deserialize a POINT_2D from a WKB encoded blob.
ST_Point2DFromWKB(blob)ST_Point2DFromWKB(blob)
blob |
|
POINT_2D
The spatial extension (LOAD spatial;).
Creates a POINT_3D.
ST_Point3D(x, y, z)ST_Point3D(x, y, z)
x, y, z
|
|
POINT_3D
The spatial extension (LOAD spatial;).
Creates a POINT_4D.
ST_Point4D(x, y, z, m)ST_Point4D(x, y, z, m)
x, y, z, m
|
|
POINT_4D
The spatial extension (LOAD spatial;).
Returns the n'th vertex from the input geometry as a point geometry.
ST_PointN(geom, index)ST_PointN(geom, index)
geom |
|
index |
|
GEOMETRY | POINT_2D
ST_PointN(geom = GEOMETRY, index = INTEGER)
ST_PointN(linestring = LINESTRING_2D, index = INTEGER)
The spatial extension (LOAD spatial;).
Returns a point guaranteed to lie on the surface of the geometry.
ST_PointOnSurface(geom)ST_PointOnSurface(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Collects all the vertices in the geometry into a MULTIPOINT.
ST_Points(geom)ST_Points(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_Points('LINESTRING(1 1, 2 2)'::GEOMETRY);
-- MULTIPOINT (1 1, 2 2)
--
-- SELECT ST_Points('MULTIPOLYGON Z EMPTY'::GEOMETRY);
-- MULTIPOINT Z EMPTY
Deserialize a POLYGON_2D from a WKB encoded blob.
ST_Polygon2DFromWKB(blob)ST_Polygon2DFromWKB(blob)
blob |
|
POLYGON_2D
The spatial extension (LOAD spatial;).
Returns a polygonized representation of the input geometries.
ST_Polygonize(geometries)ST_Polygonize(geometries)
geometries |
|
GEOMETRY
The spatial extension (LOAD spatial;).
-- Create a polygon from a closed linestring ring
SELECT ST_Polygonize([
ST_GeomFromText('LINESTRING(0 0, 0 10, 10 10, 10 0, 0 0)')
]);
---
GEOMETRYCOLLECTION (POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0)))
Compute the quadkey for a given lon/lat point at a given level. Note that the parameter order is longitude, latitude.
level has to be between 1 and 23, inclusive.
The input coordinates will be clamped to the lon/lat bounds of the earth (longitude between -180 and 180, latitude between -85.05112878 and 85.05112878).
The geometry overload throws an error if the input geometry is not a POINT.
ST_QuadKey(longitude, latitude, level)ST_QuadKey(longitude, latitude, level)
longitude |
|
latitude |
|
level |
|
VARCHAR
ST_QuadKey(longitude = DOUBLE, latitude = DOUBLE, level = INTEGER)
ST_QuadKey(point = GEOMETRY, level = INTEGER)
The spatial extension (LOAD spatial;).
SELECT ST_QuadKey(ST_Point(11.08, 49.45), 10); -- 1333203202
Read and import a variety of geospatial file formats using the GDAL library.
The ST_Read table function is based on the GDAL translator library and enables reading spatial data from a variety of geospatial vector file formats as if they were DuckDB tables.
See ST_Drivers for a list of supported file formats and drivers.
Except for the path parameter, all parameters are optional.
| Parameter | Type | Description |
path |
VARCHAR | The path to the file to read. Mandatory |
sequential_layer_scan |
BOOLEAN | If set to true, the table function will scan through all layers sequentially and return the first layer that matches the given layer name. This is required for some drivers to work properly, e.g., the OSM driver. |
spatial_filter |
WKB_BLOB | If set to a WKB blob, the table function will only return rows that intersect with the given WKB geometry. Some drivers may support efficient spatial filtering natively, in which case it will be pushed down. Otherwise the filtering is done by GDAL which may be much slower. |
open_options |
VARCHAR[] | A list of key-value pairs that are passed to the GDAL driver to control the opening of the file. E.g., the GeoJSON driver supports a FLATTEN_NESTED_ATTRIBUTES=YES option to flatten nested attributes. |
layer |
VARCHAR | The name of the layer to read from the file. If NULL, the first layer is returned. Can also be a layer index (starting at 0). |
allowed_drivers |
VARCHAR[] | A list of GDAL driver names that are allowed to be used to open the file. If empty, all drivers are allowed. |
sibling_files |
VARCHAR[] | A list of sibling files that are required to open the file. E.g., the ESRI Shapefile driver requires a .shx file to be present. Although most of the time these can be discovered automatically. |
spatial_filter_box |
BOX_2D | If set to a BOX_2D, the table function will only return rows that intersect with the given bounding box. Similar to spatial_filter. |
keep_wkb |
BOOLEAN | If set, the table function will return geometries in a wkb_geometry column with the type WKB_BLOB (which can be cast to BLOB) instead of GEOMETRY. This is useful if you want to use DuckDB with more exotic geometry subtypes that DuckDB spatial doesn't support representing in the GEOMETRY type yet. |
Note that GDAL is single-threaded, so this table function will not be able to make full use of parallelism.
By using ST_Read, the spatial extension also provides “replacement scans” for common geospatial file formats, allowing you to query files of these formats as if they were tables directly.
SELECT * FROM './path/to/some/shapefile/dataset.shp';
In practice this is just syntax-sugar for calling ST_Read, so there is no difference in performance. If you want to pass additional options, you should use the ST_Read table function directly.
The following formats are currently recognized by their file extension:
| Format | Extension |
| ESRI ShapeFile | .shp |
| GeoPackage | .gpkg |
| FlatGeoBuf | .fgb |
ST_Read( col0, keep_wkb, max_batch_size, layer, sibling_files, allowed_drivers, open_options )ST_Read( col0, keep_wkb, max_batch_size, layer, sibling_files, allowed_drivers, open_options )
col0 |
|
keep_wkb |
|
max_batch_size |
|
layer |
|
sibling_files |
|
allowed_drivers |
|
open_options |
|
Unspecified.
The spatial extension (LOAD spatial;).
-- Read a Shapefile
SELECT * FROM ST_Read('some/file/path/filename.shp');
-- Read a GeoJSON file
CREATE TABLE my_geojson_table AS SELECT * FROM ST_Read('some/file/path/filename.json');
Read the metadata from a variety of geospatial file formats using the GDAL library.
The ST_Read_Meta table function accompanies the ST_Read table function, but instead of reading the contents of a file, this function scans the metadata instead.
Since the data model of the underlying GDAL library is quite flexible, most of the interesting metadata is within the returned layers column, which is a somewhat complex nested structure of DuckDB STRUCT and LIST types.
ST_Read_Meta(col0)ST_Read_Meta(col0)
col0 |
|
Unspecified.
The spatial extension (LOAD spatial;).
-- Find the coordinate reference system authority name and code for the first layers first geometry column in the file
SELECT
layers[1].geometry_fields[1].crs.auth_name as name,
layers[1].geometry_fields[1].crs.auth_code as code
FROM st_read_meta('../../tmp/data/amsterdam_roads.fgb');
The ST_ReadOsm() table function enables reading compressed OpenStreetMap data directly from a .osm.pbf file.
This function uses multithreading and zero-copy protobuf parsing which makes it a lot faster than using the ST_Read() OSM driver, however it only outputs the raw OSM data (Nodes, Ways, Relations), without constructing any geometries. For simple node entities (like PoI's) you can trivially construct POINT geometries, but it is also possible to construct LINESTRING and POLYGON geometries by manually joining refs and nodes together in SQL, although with available memory usually being a limiting factor.
The ST_ReadOSM() function also provides a "replacement scan" to enable reading from a file directly as if it were a table. This is just syntax sugar for calling ST_ReadOSM() though. Example:
SELECT * FROM 'tmp/data/germany.osm.pbf' LIMIT 5; ```.
ST_ReadOSM(col0)ST_ReadOSM(col0)
col0 |
|
Unspecified.
The spatial extension (LOAD spatial;).
SELECT *
FROM ST_ReadOSM('tmp/data/germany.osm.pbf')
WHERE tags['highway'] != []
LIMIT 5;
-- +----------------------+--------+----------------------+---------+--------------------+------------+-----------+------------------------+
-- | kind | id | tags | refs | lat | lon | ref_roles | ref_types |
-- | enum('node', 'way'… | int64 | map(varchar, varch… | int64[] | double | double | varchar[] | enum('node', 'way', … |
-- +----------------------+--------+----------------------+---------+--------------------+------------+-----------+------------------------+
-- | node | 122351 | {bicycle=yes, butt… | | 53.5492951 | 9.977553 | | |
-- | node | 122397 | {crossing=no, high… | | 53.520990100000006 | 10.0156924 | | |
-- | node | 122493 | {TMC:cid_58:tabcd_… | | 53.129614600000004 | 8.1970173 | | |
-- | node | 123566 | {highway=traffic_s… | | 54.617268200000005 | 8.9718171 | | |
-- | node | 125801 | {TMC:cid_58:tabcd_… | | 53.070685000000005 | 8.7819939 | | |
-- +----------------------+--------+----------------------+---------+--------------------+------------+-----------+------------------------+
Read a Shapefile without relying on the GDAL library.
ST_ReadSHP(col0, encoding)ST_ReadSHP(col0, encoding)
col0, encoding
|
|
Unspecified.
The spatial extension (LOAD spatial;).
Returns the geometry with all vertices reduced to the given precision.
ST_ReducePrecision(geom, precision)ST_ReducePrecision(geom, precision)
geom |
|
precision |
|
GEOMETRY
The spatial extension (LOAD spatial;).
ST_RemoveRepeatedPoints(line = LINESTRING_2D), ST_RemoveRepeatedPoints(line = LINESTRING_2D, tolerance = DOUBLE): Remove repeated points from a LINESTRING.
ST_RemoveRepeatedPoints(geom = GEOMETRY), ST_RemoveRepeatedPoints(geom = GEOMETRY, tolerance = DOUBLE): Returns the geometry with repeated points removed.
ST_RemoveRepeatedPoints(line, tolerance)ST_RemoveRepeatedPoints(line, tolerance)
line |
|
tolerance |
|
LINESTRING_2D | GEOMETRY
ST_RemoveRepeatedPoints(line = LINESTRING_2D)
ST_RemoveRepeatedPoints(line = LINESTRING_2D, tolerance = DOUBLE)
ST_RemoveRepeatedPoints(geom = GEOMETRY)
ST_RemoveRepeatedPoints(geom = GEOMETRY, tolerance = DOUBLE)
The spatial extension (LOAD spatial;).
Returns the geometry with the order of its vertices reversed.
ST_Reverse(geom)ST_Reverse(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Alias of ST_RotateZ.
ST_Rotate(geom, radians)ST_Rotate(geom, radians)
geom, radians
|
Unspecified. |
Unspecified.
The spatial extension (LOAD spatial;).
Rotates a geometry around the X axis. This is a shorthand macro for calling ST_Affine.
ST_RotateX(geom, radians)ST_RotateX(geom, radians)
geom, radians
|
Unspecified. |
Unspecified.
The spatial extension (LOAD spatial;).
-- Rotate a 3D point 90 degrees (π/2 radians) around the X-axis
SELECT ST_RotateX(ST_GeomFromText('POINT Z(0 1 0)'), pi()/2);
-- POINT Z (0 0 1)
Rotates a geometry around the Y axis. This is a shorthand macro for calling ST_Affine.
ST_RotateY(geom, radians)ST_RotateY(geom, radians)
geom, radians
|
Unspecified. |
Unspecified.
The spatial extension (LOAD spatial;).
-- Rotate a 3D point 90 degrees (π/2 radians) around the Y-axis
SELECT ST_RotateY(ST_GeomFromText('POINT Z(1 0 0)'), pi()/2);
-- POINT Z (0 0 -1)
Rotates a geometry around the Z axis. This is a shorthand macro for calling ST_Affine.
ST_RotateZ(geom, radians)ST_RotateZ(geom, radians)
geom, radians
|
Unspecified. |
Unspecified.
The spatial extension (LOAD spatial;).
-- Rotate a point 90 degrees (π/2 radians) around the Z-axis SELECT ST_RotateZ(ST_Point(1, 0), pi()/2); -- POINT (0 1)
DuckDB function ST_Scale().
ST_Scale(geom, xs, ys, zs)ST_Scale(geom, xs, ys, zs)
geom, xs, ys, zs
|
Unspecified. |
Unspecified.
ST_Scale(geom, xs, ys, zs)
ST_Scale(geom, xs, ys)
The spatial extension (LOAD spatial;).
Sets the Coordinate Reference System (CRS) identifier of the geometry.
st_setcrs(geom, crs)st_setcrs(geom, crs)
geom |
|
crs |
|
GEOMETRY
Returns the shortest line between two geometries.
ST_ShortestLine(geom1, geom2)ST_ShortestLine(geom1, geom2)
geom1, geom2
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns a simplified version of the geometry.
ST_Simplify(geom, tolerance)ST_Simplify(geom, tolerance)
geom |
|
tolerance |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns a simplified version of the geometry that preserves topology.
ST_SimplifyPreserveTopology(geom, tolerance)ST_SimplifyPreserveTopology(geom, tolerance)
geom |
|
tolerance |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Snaps the vertices and segments of a geometry to another geometry's vertices within the given tolerance.
ST_Snap(geom, snap_to, tolerance)ST_Snap(geom, snap_to, tolerance)
geom |
|
snap_to |
|
tolerance |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the start point of a LINESTRING.
ST_StartPoint(geom)ST_StartPoint(geom)
geom |
|
GEOMETRY | POINT_2D
ST_StartPoint(geom = GEOMETRY)
ST_StartPoint(line = LINESTRING_2D)
The spatial extension (LOAD spatial;).
Returns the symmetric difference of two geometries.
ST_SymDifference(geom1, geom2)ST_SymDifference(geom1, geom2)
geom1, geom2
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
The ST_TileEnvelope scalar function generates tile envelope rectangular polygons from specified zoom level and tile indices.
This is used in MVT generation to select the features corresponding to the tile extent. The envelope is in the Web Mercator
coordinate reference system (EPSG:3857). The tile pyramid starts at zoom level 0, corresponding to a single tile for the
world. Each zoom level doubles the number of tiles in each direction, such that zoom level 1 is 2 tiles wide by 2 tiles high,
zoom level 2 is 4 tiles wide by 4 tiles high, and so on. Tile indices start at [x=0, y=0] at the top left, and increase
down and right. For example, at zoom level 2, the top right tile is [x=3, y=0], the bottom left tile is [x=0, y=3], and
the bottom right is [x=3, y=3].
SELECT ST_TileEnvelope(2, 3, 1); ```. [x=0, y=0]: R:x=0,%20y=0 [x=3, y=0]: R:x=3,%20y=0 [x=0, y=3]: R:x=0,%20y=3 [x=3, y=3]: R:x=3,%20y=3
ST_TileEnvelope(tile_zoom, tile_x, tile_y)ST_TileEnvelope(tile_zoom, tile_x, tile_y)
tile_zoom, tile_x, tile_y
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
SELECT ST_TileEnvelope(2, 3, 1); -- +-----------------------------------------------------------------------------------------------------------+ -- | st_tileenvelope(2, 3, 1) | -- | geometry | -- +-----------------------------------------------------------------------------------------------------------+ -- | POLYGON ((1.00188E+07 0, 1.00188E+07 1.00188E+07, 2.00375E+07 1.00188E+07, 2.00375E+07 0, 1.00188E+07 0)) | -- +-----------------------------------------------------------------------------------------------------------+
Returns true if the geometries touch.
ST_Touches(geom1, geom2)ST_Touches(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Transforms a geometry between two coordinate systems
The source and target coordinate systems can be specified using any format that the PROJ library supports.
The third optional always_xy parameter can be used to force the input and output geometries to be interpreted as having a [easting, northing] coordinate axis order regardless of what the source and target coordinate system definition says. This is particularly useful when transforming to/from the WGS84/EPSG:4326 coordinate system (what most people think of when they hear "longitude"/"latitude" or "GPS coordinates"), which is defined as having a [latitude, longitude] axis order even though [longitude, latitude] is commonly used in practice (e.g. in GeoJSON). More details available in the PROJ documentation.
DuckDB spatial vendors its own static copy of the PROJ database of coordinate systems, so if you have your own installation of PROJ on your system the available coordinate systems may differ to what's available in other GIS software.
ST_Transform(box, source_crs, target_crs, always_xy)ST_Transform(box, source_crs, target_crs, always_xy)
box |
|
source_crs |
|
target_crs |
|
always_xy |
|
BOX_2D | POINT_2D | GEOMETRY
ST_Transform(box = BOX_2D, source_crs = VARCHAR, target_crs = VARCHAR)
ST_Transform(box = BOX_2D, source_crs = VARCHAR, target_crs = VARCHAR, always_xy = BOOLEAN)
ST_Transform(point = POINT_2D, source_crs = VARCHAR, target_crs = VARCHAR)
ST_Transform(point = POINT_2D, source_crs = VARCHAR, target_crs = VARCHAR, always_xy = BOOLEAN)
ST_Transform(geom = GEOMETRY, source_crs = VARCHAR, target_crs = VARCHAR)
ST_Transform(geom = GEOMETRY, source_crs = VARCHAR, target_crs = VARCHAR, always_xy = BOOLEAN)
ST_Transform(geom = GEOMETRY, target_crs = VARCHAR)
ST_Transform(geom = GEOMETRY, target_crs = VARCHAR, always_xy = BOOLEAN)
The spatial extension (LOAD spatial;).
-- Transform a geometry from EPSG:4326 to EPSG:3857 (WGS84 to WebMercator)
-- Note that since WGS84 is defined as having a [latitude, longitude] axis order
-- we follow the standard and provide the input geometry using that axis order,
-- but the output will be [easting, northing] because that is what's defined by
-- WebMercator.
SELECT
ST_Transform(
st_point(52.373123, 4.892360),
'EPSG:4326',
'EPSG:3857'
);
-- POINT (544615.0239773799 6867874.103539125)
--
-- -- Alternatively, let's say we got our input point from e.g. a GeoJSON file,
-- -- which uses WGS84 but with [longitude, latitude] axis order. We can use the
-- -- `always_xy` parameter to force the input geometry to be interpreted as having
-- -- a [northing, easting] axis order instead, even though the source coordinate
-- -- reference system definition (WGS84) says otherwise.
--
-- SELECT
-- ST_Transform(
-- -- note the axis order is reversed here
-- st_point(4.892360, 52.373123),
-- 'EPSG:4326',
-- 'EPSG:3857',
-- always_xy := true
-- );
-- POINT (544615.0239773799 6867874.103539125)
--
-- -- Transform a geometry from OSG36 British National Grid EPSG:27700 to EPSG:4326 WGS84
-- -- Standard transform is often fine for the first few decimal places before being wrong
-- -- which could result in an error starting at about 10m and possibly much more
-- SELECT ST_Transform(bng, 'EPSG:27700', 'EPSG:4326', xy := true) AS without_grid_file
-- FROM (SELECT ST_GeomFromText('POINT( 170370.718 11572.405 )') AS bng);
-- POINT (-5.202992651563592 49.96007490162923)
--
-- -- By using an official NTv2 grid file, we can reduce the error down around the 9th decimal place
-- -- which in theory is below a millimetre, and in practise unlikely that your coordinates are that precise
-- -- British National Grid "NTv2 format files" download available here:
-- -- https://www.ordnancesurvey.co.uk/products/os-net/for-developers
-- SELECT ST_Transform(bng
-- , '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs +nadgrids=/full/path/to/OSTN15-NTv2/OSTN15_NTv2_OSGBtoETRS.gsb +type=crs'
-- , 'EPSG:4326', xy := true) AS with_grid_file
-- FROM (SELECT ST_GeomFromText('POINT( 170370.718 11572.405 )') AS bng) t;
-- POINT (-5.203046090608746 49.96006137018598)
DuckDB function ST_Translate().
ST_Translate(geom, dx, dy, dz)ST_Translate(geom, dx, dy, dz)
geom, dx, dy, dz
|
Unspecified. |
Unspecified.
ST_Translate(geom, dx, dy, dz)
ST_Translate(geom, dx, dy)
The spatial extension (LOAD spatial;).
Translates and then scales a geometry in X and Y direction. This is a shorthand macro for calling ST_Affine.
ST_TransScale(geom, dx, dy, xs, ys)ST_TransScale(geom, dx, dy, xs, ys)
geom, dx, dy, xs, ys
|
Unspecified. |
Unspecified.
The spatial extension (LOAD spatial;).
-- Translate by (1, 2) then scale by (2, 3) SELECT ST_TransScale(ST_Point(1, 1), 1, 2, 2, 3); -- POINT (4 9)
Returns the union of two geometries.
ST_Union(geom1, geom2)ST_Union(geom1, geom2)
geom1, geom2
|
|
GEOMETRY
The spatial extension (LOAD spatial;).
Computes the union of a set of input geometries.
ST_Union_Agg(col0)ST_Union_Agg(col0)
col0 |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns the Voronoi diagram of the supplied MultiPoint geometry.
ST_VoronoiDiagram(geom)ST_VoronoiDiagram(geom)
geom |
|
GEOMETRY
The spatial extension (LOAD spatial;).
Returns true if the first geometry is within the second.
ST_Within(geom1, geom2)ST_Within(geom1, geom2)
geom1 |
|
geom2 |
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns true if the first geometry \"properly\" is contained by the second geometry
This function functions the same as ST_ContainsProperly, but the arguments are swapped.
ST_WithinProperly(geom1, geom2)ST_WithinProperly(geom1, geom2)
geom1, geom2
|
|
BOOLEAN
The spatial extension (LOAD spatial;).
Returns the X coordinate of a point geometry.
ST_X(geom)ST_X(geom)
geom |
|
DOUBLE
ST_X(geom = GEOMETRY)
ST_X(point = POINT_2D)
The spatial extension (LOAD spatial;).
SELECT ST_X(ST_Point(1, 2))
Returns the maximum X coordinate of a geometry.
ST_XMax(box)ST_XMax(box)
box |
|
DOUBLE | FLOAT
ST_XMax(geom = GEOMETRY)
ST_XMax(point = POINT_2D)
ST_XMax(line = LINESTRING_2D)
ST_XMax(polygon = POLYGON_2D)
ST_XMax(box = BOX_2D)
ST_XMax(box = BOX_2DF)
The spatial extension (LOAD spatial;).
SELECT ST_XMax(ST_Point(1, 2))
Returns the minimum X coordinate of a geometry.
ST_XMin(box)ST_XMin(box)
box |
|
DOUBLE | FLOAT
ST_XMin(geom = GEOMETRY)
ST_XMin(point = POINT_2D)
ST_XMin(line = LINESTRING_2D)
ST_XMin(polygon = POLYGON_2D)
ST_XMin(box = BOX_2D)
ST_XMin(box = BOX_2DF)
The spatial extension (LOAD spatial;).
SELECT ST_XMin(ST_Point(1, 2))
Returns the Y coordinate of a point geometry.
ST_Y(geom)ST_Y(geom)
geom |
|
DOUBLE
ST_Y(geom = GEOMETRY)
ST_Y(point = POINT_2D)
The spatial extension (LOAD spatial;).
SELECT ST_Y(ST_Point(1, 2))
Returns the maximum Y coordinate of a geometry.
ST_YMax(box)ST_YMax(box)
box |
|
DOUBLE | FLOAT
ST_YMax(geom = GEOMETRY)
ST_YMax(point = POINT_2D)
ST_YMax(line = LINESTRING_2D)
ST_YMax(polygon = POLYGON_2D)
ST_YMax(box = BOX_2D)
ST_YMax(box = BOX_2DF)
The spatial extension (LOAD spatial;).
SELECT ST_YMax(ST_Point(1, 2))
Returns the minimum Y coordinate of a geometry.
ST_YMin(box)ST_YMin(box)
box |
|
DOUBLE | FLOAT
ST_YMin(geom = GEOMETRY)
ST_YMin(point = POINT_2D)
ST_YMin(line = LINESTRING_2D)
ST_YMin(polygon = POLYGON_2D)
ST_YMin(box = BOX_2D)
ST_YMin(box = BOX_2DF)
The spatial extension (LOAD spatial;).
SELECT ST_YMin(ST_Point(1, 2))
Returns the Z coordinate of a point geometry.
ST_Z(geom)ST_Z(geom)
geom |
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT ST_Z(ST_Point(1, 2, 3))
Returns the maximum Z coordinate of a geometry.
ST_ZMax(geom)ST_ZMax(geom)
geom |
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT ST_ZMax(ST_Point(1, 2, 3))
Returns a flag indicating the presence of Z and M values in the input geometry. 0 = No Z or M values 1 = M values only 2 = Z values only 3 = Z and M values.
ST_ZMFlag(geom)ST_ZMFlag(geom)
geom |
|
UTINYINT
The spatial extension (LOAD spatial;).
-- ZMFlag for a 2D geometry
SELECT ST_ZMFlag(ST_GeomFromText('POINT(1 1)'));
-- 0
--
-- -- ZMFlag for a 3DZ geometry
-- SELECT ST_ZMFlag(ST_GeomFromText('POINT Z(1 1 1)'));
-- 2
--
-- -- ZMFlag for a 3DM geometry
-- SELECT ST_ZMFlag(ST_GeomFromText('POINT M(1 1 1)'));
-- 1
--
-- -- ZMFlag for a 4D geometry
-- SELECT ST_ZMFlag(ST_GeomFromText('POINT ZM(1 1 1 1)'));
-- 3
Returns the minimum Z coordinate of a geometry.
ST_ZMin(geom)ST_ZMin(geom)
geom |
|
DOUBLE
The spatial extension (LOAD spatial;).
SELECT ST_ZMin(ST_Point(1, 2, 3))
DuckDB function start_ui().
start_ui()start_ui()
Unspecified.
The ui extension (LOAD ui;).
DuckDB function start_ui_server().
start_ui_server()start_ui_server()
Unspecified.
The ui extension (LOAD ui;).
Returns true if string begins with search_string.
starts_with(string, search_string)starts_with(string, search_string)
string, search_string
|
|
BOOLEAN
starts_with('abc', 'a')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns a string with statistics about the expression. Expression can be a column, constant, or SQL expression.
stats(expression)stats(expression)
expression |
|
VARCHAR
stats(5)
Returns the population standard deviation.
stddev_pop(x)stddev_pop(x)
x |
|
DOUBLE
sqrt(var_pop(x))
Returns the sample standard deviation.
stddev_samp(x)stddev_samp(x)
x |
|
DOUBLE
sqrt(var_samp(x))
DuckDB function stem().
stem(col0, col1)stem(col0, col1)
col0, col1
|
|
VARCHAR
The fts extension (LOAD fts;).
DuckDB function stop_ui_server().
stop_ui_server()stop_ui_server()
Unspecified.
The ui extension (LOAD ui;).
DuckDB function storage_info().
storage_info(col0)storage_info(col0)
col0 |
|
Unspecified.
Converts a date to a string according to the format string.
strftime(data, format)strftime(data, format)
data |
|
format |
|
VARCHAR
strftime(date '1992-01-01', '%a, %-d %B %Y')
Concatenates the column string values with an optional separator.
string_agg(str, arg)string_agg(str, arg)
str |
|
arg |
|
VARCHAR
string_agg(str = ANY)
string_agg(str = ANY, arg = VARCHAR)
string_agg(A, '-')
Splits the string along the separator.
string_split(string, separator)string_split(string, separator)
string, separator
|
|
VARCHAR[]
string_split('hello-world', '-')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Splits the string along the regex. A set of optional regex options can be set.
string_split_regex(string, regex, options)string_split_regex(string, regex, options)
string, regex, options
|
|
VARCHAR[]
string_split_regex(string = VARCHAR, regex = VARCHAR)
string_split_regex(string = VARCHAR, regex = VARCHAR, options = VARCHAR)
string_split_regex('hello world; 42', ';? ')
Other regex:
regexp_escape(),
regexp_extract(),
regexp_extract_all(),
regexp_full_match(),
regexp_matches(),
regexp_replace()
Strips accents from string.
strip_accents(string)strip_accents(string)
string |
|
VARCHAR
strip_accents('mühleisen')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Number of bytes in string.
strlen(string)strlen(string)
string |
|
BIGINT
strlen('🦆')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
strptime(text = VARCHAR, format = VARCHAR): Converts the string text to timestamp according to the format string. Throws an error on failure. To return NULL on failure, use try_strptime.
strptime(text = VARCHAR, format.list = `VARCHAR[]`): Converts the string text to timestamp applying the format strings in the list until one succeeds. Throws an error on failure. To return NULL on failure, use try_strptime.
strptime(text, format)strptime(text, format)
text, format
|
|
TIMESTAMP
strptime(text = VARCHAR, format = VARCHAR)
strptime(text = VARCHAR, format.list = `VARCHAR[]`)
strptime('Wed, 1 January 1992 - 08:38:40 PM', '%a, %-d %B %Y - %I:%M:%S %p')
strptime('4/15/2023 10:56:00', ['%d/%m/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S'])
Merge the multiple STRUCTs into a single STRUCT.
struct_concat()struct_concat()
STRUCT
struct_concat(struct_pack(i := 4), struct_pack(s := 'string'))
Check if an unnamed STRUCT contains the value.
struct_contains(struct, entry)struct_contains(struct, entry)
struct |
|
entry |
|
BOOLEAN
struct_contains(ROW(3, 3, 0), 3)
Extract the named entry from the STRUCT.
struct_extract(struct, entry)struct_extract(struct, entry)
struct |
|
entry |
|
ANY
struct_extract({'i': 3, 'v2': 3, 'v3': 0}, 'i')
Extract the entry from the STRUCT by position (starts at 1!).
struct_extract_at(struct, entry)struct_extract_at(struct, entry)
struct |
|
entry |
|
ANY
struct_extract_at({'i': 3, 'v2': 3, 'v3': 0}, 2)
Adds field(s)/value(s) to an existing STRUCT with the argument values. The entry name(s) will be the bound variable name(s).
struct_insert()struct_insert()
STRUCT
struct_insert({'a': 1}, b := 2)
Returns the field names of a STRUCT as a list.
struct_keys(struct)struct_keys(struct)
struct |
|
VARCHAR[]
struct_keys({'a': 1, 'b': 2})
Create a STRUCT containing the argument values. The entry name will be the bound variable name.
struct_pack()struct_pack()
STRUCT
struct_pack(i := 4, s := 'string')
Get the position of the entry in an unnamed STRUCT, starting at 1.
struct_position(struct, entry)struct_position(struct, entry)
struct |
|
entry |
|
INTEGER
struct_position(ROW(3, 3, 0), 3)
Changes field(s)/value(s) to an existing STRUCT with the argument values. The entry name(s) will be the bound variable name(s).
struct_update()struct_update()
STRUCT
struct_update({'a': 1}, a := 2)
Returns the field values of a STRUCT as an UnnamedStruct.
struct_values(struct)struct_values(struct)
struct |
|
STRUCT
struct_values({'a': 1, 'b': 'world'})
Extracts substring starting from character start up to the end of the string. If optional argument length is set, extracts a substring of length characters instead. Note that a start value of 1 refers to the first character of the string.
substring(string, start, length)substring(string, start, length)
string |
|
start |
|
length |
|
VARCHAR
substring(string = VARCHAR, start = BIGINT, length = BIGINT)
substring(string = VARCHAR, start = BIGINT)
substring('Hello', 2)
substring('Hello', 2, 2)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Extracts substring starting from grapheme clusters start up to the end of the string. If optional argument length is set, extracts a substring of length grapheme clusters instead. Note that a start value of 1 refers to the first character of the string.
substring_grapheme(string, start, length)substring_grapheme(string, start, length)
string |
|
start |
|
length |
|
VARCHAR
substring_grapheme(string = VARCHAR, start = BIGINT, length = BIGINT)
substring_grapheme(string = VARCHAR, start = BIGINT)
substring_grapheme('🦆🤦🏼♂️🤦🏽♀️🦆', 3)
substring_grapheme('🦆🤦🏼♂️🤦🏽♀️🦆', 3, 2)
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
DuckDB function subtract().
subtract(col0, col1)subtract(col0, col1)
col0 |
|
col1 |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIGNUM | DATE | INTERVAL | TIMESTAMP | TIME | TIME WITH TIME ZONE
subtract(col0 = TINYINT)
subtract(col0 = TINYINT, col1 = TINYINT)
subtract(col0 = SMALLINT)
subtract(col0 = SMALLINT, col1 = SMALLINT)
subtract(col0 = INTEGER)
subtract(col0 = INTEGER, col1 = INTEGER)
subtract(col0 = BIGINT)
subtract(col0 = BIGINT, col1 = BIGINT)
subtract(col0 = HUGEINT)
subtract(col0 = HUGEINT, col1 = HUGEINT)
subtract(col0 = FLOAT)
subtract(col0 = FLOAT, col1 = FLOAT)
subtract(col0 = DOUBLE)
subtract(col0 = DOUBLE, col1 = DOUBLE)
subtract(col0 = DECIMAL)
subtract(col0 = DECIMAL, col1 = DECIMAL)
subtract(col0 = UTINYINT)
subtract(col0 = UTINYINT, col1 = UTINYINT)
subtract(col0 = USMALLINT)
subtract(col0 = USMALLINT, col1 = USMALLINT)
subtract(col0 = UINTEGER)
subtract(col0 = UINTEGER, col1 = UINTEGER)
subtract(col0 = UBIGINT)
subtract(col0 = UBIGINT, col1 = UBIGINT)
subtract(col0 = UHUGEINT)
subtract(col0 = UHUGEINT, col1 = UHUGEINT)
subtract(col0 = BIGNUM)
subtract(col0 = BIGNUM, col1 = BIGNUM)
subtract(col0 = DATE, col1 = DATE)
subtract(col0 = DATE, col1 = INTEGER)
subtract(col0 = TIMESTAMP, col1 = TIMESTAMP)
subtract(col0 = INTERVAL, col1 = INTERVAL)
subtract(col0 = DATE, col1 = INTERVAL)
subtract(col0 = TIME, col1 = INTERVAL)
subtract(col0 = TIMESTAMP, col1 = INTERVAL)
subtract(col0 = `TIME WITH TIME ZONE`, col1 = INTERVAL)
subtract(col0 = INTERVAL)
Returns true if string ends with search_string.
suffix(string, search_string)suffix(string, search_string)
string, search_string
|
|
BOOLEAN
suffix('abc', 'bc')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Calculates the sum value for all tuples in arg.
sum(arg)sum(arg)
arg |
|
DECIMAL | HUGEINT | DOUBLE | BIGNUM
sum(A)
Internal only. Calculates the sum value for all tuples in arg without overflow checks.
sum_no_overflow(arg)sum_no_overflow(arg)
arg |
|
HUGEINT | DECIMAL
sum_no_overflow(A)
DuckDB function summary().
summary(col0)summary(col0)
col0 |
|
Unspecified.
Creates a switch statement similar to CASE WHEN/THEN.
switch(key, map)switch(key, map)
key |
|
map |
|
V
switch(key = K, map = `MAP(K, V)`)
switch(key = K, map = `MAP(K, V)`, value = V)
switch(key = `MAP(K, V)`, map = V)
switch(key = `MAP(K, V)`)
switch(x, map({1 : 1}, default)
DuckDB function table_info().
table_info(col0)table_info(col0)
col0 |
|
Unspecified.
Computes the tan of x.
tan(x)tan(x)
x |
|
DOUBLE
tan(90)
Computes the hyperbolic tan of x.
tanh(x)tanh(x)
x |
|
DOUBLE
tanh(1)
DuckDB function test_all_types().
test_all_types(use_large_bignum, use_large_enum)test_all_types(use_large_bignum, use_large_enum)
use_large_bignum, use_large_enum
|
|
Unspecified.
DuckDB function test_vector_types().
test_vector_types(col0, all_flat)test_vector_types(col0, all_flat)
col0 |
|
all_flat |
|
Unspecified.
DuckDB function text().
text(col0, col1)text(col0, col1)
col0 |
|
col1 |
|
VARCHAR
The excel extension (LOAD excel;).
Truncate TIMESTAMPTZ by the specified interval bucket_width. Buckets are aligned relative to origin TIMESTAMPTZ. The origin defaults to 2000-01-03 00:00:00+00 for buckets that do not include a month or year interval, and to 2000-01-01 00:00:00+00 for month and year buckets.
time_bucket(bucket_width, timestamp, origin)time_bucket(bucket_width, timestamp, origin)
bucket_width |
|
timestamp |
|
origin |
|
DATE | TIMESTAMP | TIMESTAMP WITH TIME ZONE
time_bucket(bucket_width = INTERVAL, timestamp = DATE)
time_bucket(bucket_width = INTERVAL, timestamp = DATE, origin = DATE)
time_bucket(bucket_width = INTERVAL, timestamp = DATE, origin = INTERVAL)
time_bucket(bucket_width = INTERVAL, timestamp = TIMESTAMP)
time_bucket(bucket_width = INTERVAL, timestamp = TIMESTAMP, origin = INTERVAL)
time_bucket(bucket_width = INTERVAL, timestamp = TIMESTAMP, origin = TIMESTAMP)
time_bucket(bucket_width = INTERVAL, timestamp = `TIMESTAMP WITH TIME ZONE`)
time_bucket(bucket_width = INTERVAL, timestamp = `TIMESTAMP WITH TIME ZONE`, origin = INTERVAL)
time_bucket(bucket_width = INTERVAL, timestamp = `TIMESTAMP WITH TIME ZONE`, origin = `TIMESTAMP WITH TIME ZONE`)
time_bucket(bucket_width = INTERVAL, timestamp = `TIMESTAMP WITH TIME ZONE`, origin = VARCHAR)
time_bucket(INTERVAL '2 weeks', TIMESTAMP '1992-04-20 15:26:00-07', TIMESTAMP '1992-04-01 00:00:00-07')
Converts a TIME WITH TIME ZONE to an integer sort key.
timetz_byte_comparable(time_tz)timetz_byte_comparable(time_tz)
time_tz |
|
UBIGINT
timetz_byte_comparable('18:18:16.21-07:00'::TIMETZ)
Extract the timezone component from a date or timestamp.
timezone(ts, col1)timezone(ts, col1)
ts |
|
col1 |
|
BIGINT | TIME WITH TIME ZONE | TIMESTAMP WITH TIME ZONE | TIMESTAMP
timezone(ts = DATE)
timezone(ts = INTERVAL)
timezone(ts = INTERVAL, col1 = `TIME WITH TIME ZONE`)
timezone(ts = TIMESTAMP)
timezone(ts = `TIMESTAMP WITH TIME ZONE`)
timezone(ts = VARCHAR, col1 = TIMESTAMP)
timezone(ts = VARCHAR, col1 = `TIMESTAMP WITH TIME ZONE`)
timezone(ts = VARCHAR, col1 = `TIME WITH TIME ZONE`)
timezone(timestamp '2021-08-03 11:59:44.123456')
Extract the timezone_hour component from a date or timestamp.
timezone_hour(ts)timezone_hour(ts)
ts |
|
BIGINT
timezone_hour(timestamp '2021-08-03 11:59:44.123456')
Extract the timezone_minute component from a date or timestamp.
timezone_minute(ts)timezone_minute(ts)
ts |
|
BIGINT
timezone_minute(timestamp '2021-08-03 11:59:44.123456')
Converts number to a string in the given base radix, optionally padding with leading zeros to min_length.
to_base(number, radix, min_length)to_base(number, radix, min_length)
number |
|
radix |
|
min_length |
|
VARCHAR
to_base(number = BIGINT, radix = INTEGER)
to_base(number = BIGINT, radix = INTEGER, min_length = INTEGER)
to_base(42, 16, 5)
Other numeric:
bin(),
bit_length(),
formatReadableDecimalSize(),
format_bytes(),
greatest(),
hex(),
least(),
len(),
parse_formatted_bytes()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Converts a blob to a base64 encoded string.
to_base64(blob)to_base64(blob)
blob |
|
VARCHAR
to_base64('A'::BLOB)
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
unbin(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Construct a century interval.
to_centuries(integer)to_centuries(integer)
integer |
|
INTERVAL
to_centuries(5)
Construct a day interval.
to_days(integer)to_days(integer)
integer |
|
INTERVAL
to_days(5)
Construct a decade interval.
to_decades(integer)to_decades(integer)
integer |
|
INTERVAL
to_decades(5)
Construct a hour interval.
to_hours(integer)to_hours(integer)
integer |
|
INTERVAL
to_hours(5)
DuckDB function to_json().
to_json()to_json()
JSON
The json extension (LOAD json;).
Construct a microsecond interval.
to_microseconds(integer)to_microseconds(integer)
integer |
|
INTERVAL
to_microseconds(5)
Construct a millenium interval.
to_millennia(integer)to_millennia(integer)
integer |
|
INTERVAL
to_millennia(1)
Construct a millisecond interval.
to_milliseconds(double)to_milliseconds(double)
double |
|
INTERVAL
to_milliseconds(5.5)
Construct a minute interval.
to_minutes(integer)to_minutes(integer)
integer |
|
INTERVAL
to_minutes(5)
Construct a month interval.
to_months(integer)to_months(integer)
integer |
|
INTERVAL
to_months(5)
Construct a quarter interval.
to_quarters(integer)to_quarters(integer)
integer |
|
INTERVAL
to_quarters(5)
Construct a second interval.
to_seconds(double)to_seconds(double)
double |
|
INTERVAL
to_seconds(5.5)
Converts secs since epoch to a timestamp with time zone.
to_timestamp(sec)to_timestamp(sec)
sec |
|
TIMESTAMP WITH TIME ZONE
to_timestamp(1284352323.5)
Construct a week interval.
to_weeks(integer)to_weeks(integer)
integer |
|
INTERVAL
to_weeks(5)
Construct a year interval.
to_years(integer)to_years(integer)
integer |
|
INTERVAL
to_years(5)
DuckDB function today().
today()today()
DATE
The icu extension (LOAD icu;).
DuckDB function tpcds().
tpcds(col0)tpcds(col0)
col0 |
|
Unspecified.
The tpcds extension (LOAD tpcds;).
DuckDB function tpcds_answers().
tpcds_answers()tpcds_answers()
Unspecified.
The tpcds extension (LOAD tpcds;).
DuckDB function tpcds_queries().
tpcds_queries()tpcds_queries()
Unspecified.
The tpcds extension (LOAD tpcds;).
DuckDB function tpch().
tpch(col0)tpch(col0)
col0 |
|
Unspecified.
The tpch extension (LOAD tpch;).
DuckDB function tpch_answers().
tpch_answers()tpch_answers()
Unspecified.
The tpch extension (LOAD tpch;).
DuckDB function tpch_queries().
tpch_queries()tpch_queries()
Unspecified.
The tpch extension (LOAD tpch;).
Replaces each character in string that matches a character in the from set with the corresponding character in the to set. If from is longer than to, occurrences of the extra characters in from are deleted.
translate(string, from, to)translate(string, from, to)
string, from, to
|
|
VARCHAR
translate('12345', '143', 'ax')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Removes any occurrences of any of the characters from either side of the string. characters defaults to space.
trim(string, characters)trim(string, characters)
string, characters
|
|
VARCHAR
trim(string = VARCHAR)
trim(string = VARCHAR, characters = VARCHAR)
trim(' test ')
trim('>>>>test<<', '><')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Truncates the number.
trunc(x, col1)trunc(x, col1)
x |
|
col1 |
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | FLOAT | DOUBLE | DECIMAL | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT
trunc(x = TINYINT)
trunc(x = TINYINT, col1 = INTEGER)
trunc(x = SMALLINT)
trunc(x = SMALLINT, col1 = INTEGER)
trunc(x = INTEGER)
trunc(x = INTEGER, col1 = INTEGER)
trunc(x = BIGINT)
trunc(x = BIGINT, col1 = INTEGER)
trunc(x = HUGEINT)
trunc(x = HUGEINT, col1 = INTEGER)
trunc(x = FLOAT)
trunc(x = FLOAT, col1 = INTEGER)
trunc(x = DOUBLE)
trunc(x = DOUBLE, col1 = INTEGER)
trunc(x = DECIMAL)
trunc(x = DECIMAL, col1 = INTEGER)
trunc(x = UTINYINT)
trunc(x = UTINYINT, col1 = INTEGER)
trunc(x = USMALLINT)
trunc(x = USMALLINT, col1 = INTEGER)
trunc(x = UINTEGER)
trunc(x = UINTEGER, col1 = INTEGER)
trunc(x = UBIGINT)
trunc(x = UBIGINT, col1 = INTEGER)
trunc(x = UHUGEINT)
trunc(x = UHUGEINT, col1 = INTEGER)
trunc(17.4)
DuckDB function truncate_duckdb_logs().
truncate_duckdb_logs()truncate_duckdb_logs()
Unspecified.
Converts the string text to timestamp according to the format string. Returns NULL on failure.
try_strptime(text, format)try_strptime(text, format)
text |
|
format |
|
TIMESTAMP
try_strptime('Wed, 1 January 1992 - 08:38:40 PM', '%a, %-d %B %Y - %I:%M:%S %p')
Returns the current transaction’s ID (a BIGINT). It will assign a new one if the current transaction does not have one already.
txid_current()txid_current()
UBIGINT
txid_current()
Returns the name of the data type of the result of the expression.
typeof(expression)typeof(expression)
expression |
|
VARCHAR
typeof('abc')
DuckDB function ui_is_started().
ui_is_started()ui_is_started()
Unspecified.
The ui extension (LOAD ui;).
Converts a value from binary representation to a blob.
unbin(value)unbin(value)
value |
|
BLOB
unbin('0110')
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unhex()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unhex(),
unicode(),
upper(),
url_decode(),
url_encode()
Converts a value from hexadecimal representation to a blob.
unhex(value)unhex(value)
value |
|
BLOB
unhex('2A')
Other blob:
decode(),
encode(),
from_base64(),
hex(),
md5(),
md5_number(),
octet_length(),
or–or,
repeat(),
sha1(),
sha256(),
to_base64(),
unbin()
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unicode(),
upper(),
url_decode(),
url_encode()
Returns an INTEGER representing the unicode codepoint of the first character in the string.
unicode(string)unicode(string)
string |
|
INTEGER
[unicode('âbcd'), unicode('â'), unicode(''), unicode(NULL)]
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
upper(),
url_decode(),
url_encode()
Extract the value with the named tags from the union. NULL if the tag is not currently selected.
union_extract(union, tag)union_extract(union, tag)
union |
|
tag |
|
ANY
union_extract(s, 'k')
Retrieve the currently selected tag of the union as an ENUM.
union_tag(union)union_tag(union)
union |
|
ANY
union_tag(union_value(k := 'foo'))
Create a single member UNION containing the argument value. The tag of the value will be the bound variable name.
union_value()union_value()
UNION
union_value(k := 'hello')
DuckDB function unity_catalog_checkpoint_table().
unity_catalog_checkpoint_table(col0)unity_catalog_checkpoint_table(col0)
col0 |
|
Unspecified.
The unity_catalog extension (LOAD unity_catalog;).
DuckDB function unity_catalog_force_checkpoint_table().
unity_catalog_force_checkpoint_table(col0)unity_catalog_force_checkpoint_table(col0)
col0 |
|
Unspecified.
The unity_catalog extension (LOAD unity_catalog;).
DuckDB function unnest().
unnest(col0)unnest(col0)
col0 |
|
Unspecified.
Identical to list_value, but generated as part of unpivot for better error messages.
unpivot_list()unpivot_list()
LIST
unpivot_list(4, 5, 6)
Other list:
array_extract(),
array_length(),
concat(),
contains(),
flatten(),
generate_series(),
len(),
list_aggregate(),
list_concat(),
list_contains(),
list_cosine_distance(),
list_cosine_similarity(),
list_distance(),
list_distinct(),
list_extract(),
list_filter(),
list_grade_up(),
list_has_all(),
list_has_any(),
list_inner_product(),
list_intersect(),
list_negative_inner_product(),
list_position(),
list_reduce(),
list_resize(),
list_reverse_sort(),
list_select(),
list_slice(),
list_sort(),
list_transform(),
list_unique(),
list_value(),
list_where(),
list_zip(),
or–or,
range(),
repeat()
Converts string to upper case.
upper(string)upper(string)
string |
|
VARCHAR
upper('Hello')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
url_decode(),
url_encode()
Decodes a URL from a representation using Percent-Encoding.
url_decode(string)url_decode(string)
string |
|
VARCHAR
url_decode('https%3A%2F%2Fduckdb.org%2Fwhy_duckdb%23portable')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_encode()
Encodes a URL to a representation using Percent-Encoding.
url_encode(string)url_encode(string)
string |
|
VARCHAR
url_encode('this string has/ special+ characters>')
Other string:
array_extract(),
ascii(),
bar(),
bin(),
bit_length(),
chr(),
concat(),
concat_ws(),
contains(),
format(),
formatReadableDecimalSize(),
format_bytes(),
from_base64(),
greatest(),
hash(),
hex(),
ilike_escape(),
instr(),
least(),
left(),
left_grapheme(),
len(),
length_grapheme(),
like_escape(),
list_slice(),
lower(),
lpad(),
ltrim(),
md5(),
md5_number(),
nfc_normalize(),
not_ilike_escape(),
not_like_escape(),
or–or,
parse_dirname(),
parse_dirpath(),
parse_filename(),
parse_formatted_bytes(),
parse_path(),
prefix(),
printf(),
repeat(),
replace(),
reverse(),
right(),
right_grapheme(),
rpad(),
rtrim(),
sha1(),
sha256(),
starts_with(),
string_split(),
strip_accents(),
strlen(),
substring(),
substring_grapheme(),
suffix(),
to_base(),
to_base64(),
translate(),
trim(),
unbin(),
unhex(),
unicode(),
upper(),
url_decode()
DuckDB function user_agent().
user_agent()user_agent()
Unspecified.
Returns a random UUID v4 similar to this: eeccb8c5-9943-b2bb-bb5e-222f4e14b687.
uuid()uuid()
UUID
uuid()
Extract the timestamp for the given UUID v7.
uuid_extract_timestamp(uuid)uuid_extract_timestamp(uuid)
uuid |
|
TIMESTAMP WITH TIME ZONE
uuid_extract_timestamp('019482e4-1441-7aad-8127-eec99573b0a0')
Extract a version for the given UUID.
uuid_extract_version(uuid)uuid_extract_version(uuid)
uuid |
|
UINTEGER
uuid_extract_version('019482e4-1441-7aad-8127-eec99573b0a0')
Returns a random UUIDv4 similar to this: eeccb8c5-9943-b2bb-bb5e-222f4e14b687.
uuidv4()uuidv4()
UUID
uuidv4()
Returns a random UUID v7 similar to this: 019482e4-1441-7aad-8127-eec99573b0a0.
uuidv7()uuidv7()
UUID
uuidv7()
Returns the population variance.
var_pop(x)var_pop(x)
x |
|
DOUBLE
Returns the sample variance of all input values.
var_samp(x)var_samp(x)
x |
|
DOUBLE
(SUM(x^2) - SUM(x)^2 / COUNT(x)) / (COUNT(x) - 1)
DuckDB function variant_bytes_to_variant().
variant_bytes_to_variant(col0)variant_bytes_to_variant(col0)
col0 |
|
VARIANT
variant_extract(input_variant = VARIANT, field = VARCHAR): Returns the field from the input_variant if it's an OBJECT.
variant_extract(input_variant = VARIANT, index = UINTEGER): Returns the entry at index from the input_variant if it's an ARRAY.
variant_extract(input_variant, field)variant_extract(input_variant, field)
input_variant |
|
field |
|
VARIANT
variant_extract(input_variant = VARIANT, field = VARCHAR)
variant_extract(input_variant = VARIANT, index = UINTEGER)
variant_extract({'a': 42, 'b': [1,2,3])::VARIANT, 'b')
variant_extract([1,2,3])::VARIANT, 0)
Other variant:
variant_normalize(),
variant_typeof()
Normalizes the input_variant to a canonical representation.
variant_normalize(input_variant)variant_normalize(input_variant)
input_variant |
|
VARIANT
variant_normalize({'b': [1,2,3], 'a': 42})::VARIANT)
Other variant:
variant_extract(),
variant_typeof()
DuckDB function variant_to_parquet_variant().
variant_to_parquet_variant(col0)variant_to_parquet_variant(col0)
col0 |
|
ANY
Returns the internal type of the input_variant.
variant_typeof(input_variant)variant_typeof(input_variant)
input_variant |
|
VARCHAR
variant_typeof({'a': 42, 'b': [1,2,3]})::VARIANT)
Other variant:
variant_extract(),
variant_normalize()
Returns the VectorType of a given column.
vector_type(col)vector_type(col)
col |
|
VARCHAR
vector_type(col)
DuckDB function verify_external().
verify_external()verify_external()
Unspecified.
DuckDB function verify_fetch_row().
verify_fetch_row()verify_fetch_row()
Unspecified.
DuckDB function verify_parallelism().
verify_parallelism()verify_parallelism()
Unspecified.
DuckDB function verify_serializer().
verify_serializer()verify_serializer()
Unspecified.
Returns the currently active version of DuckDB in this format: v0.3.2 .
version()version()
VARCHAR
version()
DuckDB function vortex_scan().
vortex_scan(col0)vortex_scan(col0)
col0 |
|
Unspecified.
The vortex extension (LOAD vortex;).
DuckDB macro vss_join().
vss_join(left_table, right_table, left_col, right_col, k, metric)vss_join(left_table, right_table, left_col, right_col, k, metric)
left_table, right_table, left_col, right_col, k, metric
|
Unspecified. |
Unspecified.
The vss extension (LOAD vss;).
DuckDB macro vss_match().
vss_match(right_table, left_col, right_col, k, metric)vss_match(right_table, left_col, right_col, k, metric)
right_table, left_col, right_col, k, metric
|
Unspecified. |
Unspecified.
The vss extension (LOAD vss;).
DuckDB macro wavg().
wavg(value, weight)wavg(value, weight)
value, weight
|
Unspecified. |
Unspecified.
Extract the week component from a date or timestamp.
week(ts)week(ts)
ts |
|
BIGINT
week(timestamp '2021-08-03 11:59:44.123456')
Extract the weekday component from a date or timestamp.
weekday(ts)weekday(ts)
ts |
|
BIGINT
weekday(timestamp '2021-08-03 11:59:44.123456')
Extract the weekofyear component from a date or timestamp.
weekofyear(ts)weekofyear(ts)
ts |
|
BIGINT
weekofyear(timestamp '2021-08-03 11:59:44.123456')
DuckDB macro weighted_avg().
weighted_avg(value, weight)weighted_avg(value, weight)
value, weight
|
Unspecified. |
Unspecified.
DuckDB function which_secret().
which_secret(col0, col1)which_secret(col0, col1)
col0, col1
|
|
Unspecified.
DuckDB macro whoami().
whoami()whoami()
Unspecified.
The quack extension (LOAD quack;).
DuckDB function write_blob().
write_blob(col0, col1)write_blob(col0, col1)
col0 |
|
col1 |
|
BOOLEAN
The delta extension (LOAD delta;).
Writes to the logger.
write_log(string)write_log(string)
string |
|
ANY
write_log('Hello')
Bitwise XOR.
xor(left, right)xor(left, right)
left, right
|
|
TINYINT | SMALLINT | INTEGER | BIGINT | HUGEINT | UTINYINT | USMALLINT | UINTEGER | UBIGINT | UHUGEINT | BIT
xor(17, 5)
Extract the year component from a date or timestamp.
year(ts)year(ts)
ts |
|
BIGINT
year(timestamp '2021-08-03 11:59:44.123456')
Extract the yearweek component from a date or timestamp.
yearweek(ts)yearweek(ts)
ts |
|
BIGINT
yearweek(timestamp '2021-08-03 11:59:44.123456')