map
Create a map from a list of keys and a list of values.
Try an expression
In Formula, enter the expression and set Output type to VARCHAR.
Expression
map(['a', 'b'], [1, 2])Result
'{a=1, b=2}'The expression returns MAP(VARCHAR, INTEGER). Formula stores it as VARCHAR in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
map(keys, values)- keys
- List
- values
- List
Supported signatures (2)
map() → MAP("NULL", "NULL")
map(keys: K[], values: V[]) → MAP(K, V)The result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
If the first argument is missing, the result is NULL.
Function metadata from DuckDB, used under the MIT license.