Skip to content

Commit 5170f5a

Browse files
committed
Update map_top_n_values description
1 parent fef0165 commit 5170f5a

File tree

1 file changed

+3
-4
lines changed
  • presto-docs/src/main/sphinx/functions

1 file changed

+3
-4
lines changed

presto-docs/src/main/sphinx/functions/map.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,10 @@ Map Functions
150150

151151
Returns all the values in the map ``x``.
152152

153-
.. function:: map_top_n_values(x(K,V), n) -> array(K)
153+
.. function:: map_top_n_values(x(K,V), n) -> array(V)
154154

155-
Returns top n values in the map ``x``.
156-
``n`` must be a positive integer
157-
For bottom ``n`` values, use the function with lambda operator to perform custom sorting.::
155+
Returns top ``n`` values in the map ``x`` by sorting its values in descending order.
156+
``n`` must be a non-negative integer. ::
158157

159158
SELECT map_top_n_values(map(ARRAY['a', 'b', 'c'], ARRAY[1, 2, 3]), 2) --- [3, 2]
160159

0 commit comments

Comments
 (0)