Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks SQL
Databricks Runtime
Filters entries in the map in expr
using the function func
.
map_filter(expr, func)
expr
: A MAP expression.func
: A lambda function with two parameters returning a BOOLEAN. The first parameter takes the key the second parameter takes the value.
The result is the same type as expr
.
> SELECT map_filter(map(1, 0, 2, 2, 3, -1), (k, v) -> k > v);
{1 -> 0, 3 -> -1}