I want to achieve this in Pig but not sure about an efficient way.
I have an input file(with header: COL1,COL2,COL3,COL4,TAG) and multiple "value" files all with similar format (TAG,VALUE). I want to append the "VALUE" column of each "value" file with the input file based on "TAG" as key column. So if there are 3 "value" files then format of final combined file will be (COL1,COL2,COL3,COL4,TAG,VALUE1,VALUE2,VALUE3).
One approach I can think of is to read each "value" file and then join with input file in an incremental way. So we will have multiple intermediate files. Like first join input file with one value file and output will be : COL1,COL2,COL3,COL4,TAG,VALUE1 .
Now this becomes new input file and join with another "value" file and output will be COL1,COL2,COL3,COL4,TAG,VALUE1,VALUE2.
Is there a better way ?