[Solved-1 Solution] How to Merging two datasets in Pig ?



What is union ?

  • The UNION operator of Pig Latin is used to merge the content of two relations. To perform UNION operation on two relations, their columns and domains must be identical.

Syntax

grunt> Relation_name3 = UNION Relation_name1, Relation_name2;

Problem:

How to Merging two datasets in Pig ?

Solution 1:

  • If the tuples have fields in differing orders, we can use the ONSCHEMA keyword when performing the UNION
A_MERGED = UNION ONSCHEMA A1, A2;

Related Searches to How to Merging two datasets in Pig ?