---
title: "map_concat function in Strata | Oplema"
description: "Merge two or more maps into a single map that holds all of their keys. Write it as map_concat(map, ...) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/map-concat"
updated: "2026-11-04"
---

# map\_concat

Merge maps into one. If a key appears more than once, the value from the last map with that key wins.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
map_concat(MAP {'key1': 10, 'key2': 20}, MAP {'key3': 30}, MAP {'key2': 5})
```

### Result

```
'{key1=10, key2=5, key3=30}'
```

The expression returns `MAP(VARCHAR, INTEGER)`. Formula stores it as `VARCHAR` in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | {key1=10, key2=5, key3=30} |

## Arguments and types

```
map_concat(map, ...) → MAP
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

### With a missing first argument

```
map_concat(NULL::MAP(VARCHAR, INTEGER), MAP {'key3': 30}, MAP {'key2': 5})
```

'{key3=30, key2=5}'

## Related functions

[map\_from\_entries

Create a map from a list of structs that each hold a key and a value.

](https://oplema.com/docs/strata/functions/map-from-entries)[element\_at

Look up a key in a map and return its value inside a list, or an empty list if the key is absent. The key must have the same type as the map's keys.

](https://oplema.com/docs/strata/functions/element-at)[map\_extract

Look up a key in a map and return its value inside a list, or an empty list if the key is absent. The key must have the same type as the map's keys.

](https://oplema.com/docs/strata/functions/map-extract)[map\_extract\_value

Look up a key in a map and return its value, or a missing value if the key is absent. The key must have the same type as the map's keys.

](https://oplema.com/docs/strata/functions/map-extract-value)

[Browse maps](https://oplema.com/docs/strata/functions#maps) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/map.html#map_concatmaps)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
