- 类别:
半结构化和结构化数据函数 (映射)
MAP_CAT¶
返回两个 MAPs 的连接结果。
语法¶
实参¶
map1源 MAP。
map2要追加到
map1的 MAP。
返回¶
此函数的返回类型是 map1 的类型。map2 按照强制转换规则被强制转换为 map1 类型。有关强制转换规则的信息,请参阅 隐式转换值(强制)。
使用说明¶
如果
map1和map2的值具有相同的键,则输出映射包含map2中的值。如果任一实参为 NULL,则此函数返回 NULL 且不报告任何错误。
示例¶
创建两个 MAPs 并将它们连接起来:
Create a temporary table that contains MAP values:
查询表以显示数据:
Concatenate the two MAP columns attrs and defaults:
The output contains the keys and values from both maps. The output also shows that when both
map1 in the attr column and map2 in the defaults column have a value
with the same key, then the output map contains the value from map2. That is,
size L is in the output for row 1 instead of size M.