title: Generic join script
body: <p>I have a project in which I calculate various data on accounts and save each data in a different file (each calculation have a different script).
  Then, I need to create the final file which combine all the data for an account.
  one way to do that is to save each output in a different directory and than in the final script load each directory with a schema, join (or co-group) by account and print. The problem here, is that I need to tell pig which directories to load.
  I wanted to make a more generic script so it will be easy to add more calculations, so I created a parent directory and saving all the outputs under that (in sub-directories). then I wrote this script</p>
  <pre><code>attributes_data=        load '$attributes_data' using CSVLoader;
  union_data=         group attributes_data by TRIM ($0);
  final_output=       foreach union_data generate
              FLATTEN(Merge_Bags(attributes_data));
  store order_data into '$final_attr' using AttributesStorer;
  </code></pre>
  <p>This way, I don't need to tell pig which files he should load, it just load all sub-directories under my output directory. the problem here, is that the order of tuples in the bag after the group by is not consistent, so my final result have no consistent order, which is a problem.</p>
  <p>I'll really apreciate your ideas to make the script generic as possible, while saving some order of data in the final result.</p>