map_filter
function
Applies to: Databricks SQL Databricks Runtime
Filters entries in the map in expr
using the function func
.
Syntax
map_filter(expr, func)
Arguments
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.
Returns
The result is the same type as expr
.
Examples
> SELECT map_filter(map(1, 0, 2, 2, 3, -1), (k, v) -> k > v);
{1 -> 0, 3 -> -1}
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for