MapToBag

Description

Transforms a hash map to a bag of hash maps where each map contains two keys: key and value.

Syntax

MapToBag(map_expression)

Examples

MapToBag(TOMAP('a',1,'b',2,'c',3)) returns a bag with the following items: [key#a,value#1],[key#b,value#2],[key#c,value#3]

Return value datatype

Bag

Impact of null value

If input is null, returns null.