ByteHouse Enterprise Edition
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]) │ └───────────────────┘