Want more features on Pastebin? Sign Up, it's FREE!
Guest

john

By: a guest on Sep 13th, 2013  |  syntax: Bash  |  size: 0.77 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. -- My Load Function load all  the columns from the rowkey and and transform the map into the bag. The bag is sorted by $0
  2. PATTERN_0 = load 'hbase://table1' using myUDFPackage.HBaseLoadUDF('mycf', '-caching 10','myKey1') as (columncontent_0:map[]);
  3. INTERMEDIATE_BAG_0 = foreach PATTERN_0 generate flatten(myUDFPackage.MapToBagUDF($0)) as (output0:chararray);
  4.  
  5. -- Same here
  6. PATTERN_1 = load 'hbase://table2' using myUDFPackage.HBaseLoadUDF('mycf', '-caching 10','myKey2') as (columncontent_1:map[]);
  7. INTERMEDIATE_BAG_1 = foreach PATTERN_1 generate flatten(myUDFPackage.MapToBagUDF($0)) as (output1:chararray);
  8.  
  9. -- Join both bags
  10. INTERMEDIATE_BAG_3 = JOIN INTERMEDIATE_BAG_0 BY $0, INTERMEDIATE_BAG_1 BY $0 USING 'merge';
  11. INTERMEDIATE_BAG_3 = FOREACH INTERMEDIATE_BAG_3 GENERATE $0;
clone this paste RAW Paste Data