Attachment 'pigLatinComplexTypes.txt'

Download

   1 register $LOCATION/zebra-$version.jar;
   2 
   3 --STR_SCHEMA = "s1:bool, s2:int, s3:long, s4:float, s5:string, s6:bytes, r1:record(f1:int, f2:long), r2:record(r3:record(f3:float, f4)), m1:map(string),m2:ma
   4 p(map(int)), c:collection(f13:double, f14:float, f15:bytes)";
   5 
   6 --STR_STORAGE = "[s1, s2]; [m1#{a}]; [r1.f1]; [s3, s4, r2.r3.f3]; [s5, s6, m2#{x|y}]; [r1.f2, m1#{b}]; [r2.r3.f4, m2#{z}]";
   7 
   8 
   9 A = LOAD '$INPUT_PATH' using org.apache.hadoop.zebra.pig.TableLoader('r1.f2, s1');
  10 DUMP A;
  11 
  12 --All the columns will be store in 1 ColumnGroup
  13 
  14 STORE A into $path using org.apache.hadoop.zebra.pig.TableStorer('c1:int, c2:bool', "");
  15 
  16 B = LOAD '$INPUT_PATH' using org.apache.hadoop.zebra.pig.TableLoader('s1, r1');
  17 DUMP B;

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.