> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> `key` 配列で指定されたキーに基づいて、`value` 配列の最大値を計算します。

# maxMap

<div id="maxMappedArrays">
  ## maxMappedArrays
</div>

導入バージョン: v20.5.0

`key` 配列で指定されたキーに基づいて、`value` 配列から最大値を計算します。

<Note>
  * キーのタプルと値の配列を渡すことは、キーの配列と値の配列を渡すのと同じです。
  * 集計対象の各行では、`key` と `value` の要素数は同じである必要があります。
</Note>

**構文**

```sql theme={null}
maxMappedArrays(key, value)
maxMappedArrays(Tuple(key, value))
```

**引数**

* `key` — キーの配列。 [`Array(T)`](/ja/reference/data-types/array)
* `value` — 値の配列。 [`Array(T)`](/ja/reference/data-types/array)

**戻り値**

2 つの配列からなるタプルを返します。1 つはソート順のキー、もう 1 つは対応するキーごとに計算された値です。 [`Tuple(Array(T), Array(T))`](/ja/reference/data-types/tuple)

**例**

**使用例**

```sql title=Query theme={null}
SELECT maxMappedArrays(a, b)
FROM VALUES('a Array(Char), b Array(Int64)', (['x', 'y'], [2, 2]), (['y', 'z'], [3, 1]));
```

```response title=Response theme={null}
┌─maxMappedArrays(a, b)───┐
│ (['x','y','z'],[2,3,1]) │
└─────────────────────────┘
```
