You need to enable JavaScript to run this app.
ByteHouse Enterprise Edition

ByteHouse Enterprise Edition

Copy page
Download PDF
Aggregate function
maxmap
Copy page
Download PDF
maxmap

Grammar

maxMap(key, value) 
or 
maxMap(Tuple(key, value))

Calculates the Maximum of the value array based on the keys specified in the key array.
Passing a tuple of the key and value array is synonymous and passing two arrays of the key and value.
The Quantity of key and value (array) Elements to Total for Every row must be the same.
Backs a tuple consisting of two arrays: the sorted key and the Calculated value (Maximum) corresponding to the key.
Example:

SELECT maxMap(a, b) 
FROM values('a Array(Int32), b Array(Int64)', ([1, 2], [2, 2]), ([2, 3], [1, 1]))
┌─maxMap(a, b)──────┐ 
│ ([1,2,3],[2,2,1]) │ 
└───────────────────┘
Last updated: 2026.03.31 11:50:00