pt = LOAD 'data'
B = GROUP pt ALL;
C = FOREACH B GENERATE COUNT(pt);
DUMP C;
Thursday, July 23, 2009
pig on hadoop: count all rows
actionscript 3: dynamically add attribute to xml element
pf is an XML object, cols is an array of attribute values, and headers is an array of attribute names.
The @[variable name] syntax works the magic.
The @[variable name] syntax works the magic.
for(var cn:int=0;cn<cols.length;cn++){
var col_name:String = headers[cn];
pf.ROW[rn-1].@[col_name]=cols[cn];
}
Subscribe to:
Posts (Atom)