S-JIS[2011-08-14/2011-09-22] 変更履歴 Pigユーザー定義関数 Pigのユーザー定義関数(User Defined Function:UDF)の作り方のメモ。 クラス作成 Pigで使う関数を作るには、org.apache.pig.EvalFuncを継承したクラスを作成し、exec()メソッドをオーバーライドする。 EvalFuncの型引数にはexec()の戻り型を指定する。 package pigudf; import java.io.IOException; import org.apache.pig.EvalFunc; import org.apache.pig.data.Tuple; public class SampleUDF extends EvalFunc<String> { @Override public String exec(Tuple in