map_extract_value
Look up a key in a map and return its value, or a missing value if the key is absent. The key must have the same type as the map's keys.
Try an expression
In Formula, enter the expression and set Output type to INTEGER.
Expression
map_extract_value(map([100, 5], [42, 43]), 100)Result
42To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
map_extract_value(map, key)- map
- Map
- key
- Any value
Supported signatures (1)
map_extract_value(map: MAP(K, V), key: K) → VThe 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.