SQL map functions
Use map functions to create and operate on Arrow maps in SQL queries.
element_at
Alias of map_extract.
make_map
Returns an Arrow map with the specified key and value.
make_map(key, value)
Arguments
- key: Expression to use for the key. Can be a constant, column, function, or any combination of arithmetic or string operators.
- value: Expression to use for the value. Can be a constant, column, function, or any combination of arithmetic or string operators.
map
Returns an Arrow map with the specified key-value pairs. Keys are mapped to values by their positions in each respective list. Each key must be unique and non-null.
map(key_list, value_list)
-- or
map { key: value, ... }
Arguments
- key_list: List of keys to use in the map. Each key must be unique and non-null.
- value_list: List of values to map to the corresponding keys.
map_extract
Returns a list containing the value for the given key or an empty list if the Returns a list containing the value for the given key, or an empty list if the key is not present in the map. The returned list will contain exactly one element (the value) when the key is found.
map_extract(map, key)
Arguments
- map: Map expression. Can be a constant, column, or function, and any combination of map operators.
- key: Key to extract from the map. Can be a constant, column, or function, any combination of arithmetic or string operators, or a named expression of the previously listed.
Aliases
element_at
Related functions
map_keys
Returns a list of all keys in the map.
map_keys(map)
Arguments
- map: Map expression. Can be a constant, column, or function, and any combination of map operators.
Related functions
map_values
Returns a list of all values in the map.
map_values(map)
Arguments
- map: Map expression. Can be a constant, column, or function, and any combination of map operators.
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB Cloud Dedicated and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.