The pig does the right thing here and combines the data sets. All being one file does not mean one dataset in Hadoop ... one dataset in Hadoop is usually a folder. Since there is no need to start the reduction, this will not happen.
You need to trick the Pig in order to run the card and reduce it. I usually do this:
set default_parallel 1 ... A = UNION Message_1,Message_2,Message_3,Message_4; B = GROUP A BY 1;
GROUP BY groups all the records together, and then FLATTEN blows up this list.
It should be noted here that this is not much different from that:
$ hadoop fs -cat msg1.txt msg2.txt msg3.txt msg4.txt | hadoop fs -put - union.txt
(this is the concatenation of all the text, and then writing it back to HDFS as a new file)
This is not parallel at all, but not one of them redirects all your data through one reducer.
Donald miner
source share