Script Apache Pig (Hadoop) + UDF Ruby
# test.rbrequire ‘pigudf’require ‘java’class Myudfs < PigUdf outputSchema “word:chararray” def concat *input input.compact.inject(:+) endend # test.pigregister ./test.rb using jruby as myfuncs;t = LOAD ‘test.txt’ USING PigStorage(‘,’) AS (a:chararray, b:chararray);v = …
Continuar lendo