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, 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.
Arguments and types
map_concat(map, ...) → MAPThe 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}'
Function metadata from DuckDB, used under the MIT license.