A bag
is one of the data models present in Pig. It is an unordered collection of
tuples with possible duplicates. Bags are used to store collections while
grouping. The size of bag is the size of the local disk, this means that the
size of the bag is limited. When the bag is full, then Pig will spill this bag
into local disk and keep only some parts of the bag in memory. There is no
necessity that the complete bag should fit into memory. We represent bags with
“{}”.