0
我在UDFS中有一個參數化構造函數。從豬腳本向UDF中的參數化構造函數傳遞值
public WordMapList(String filePath)
{
filePt=filePath;
}
與作爲主要的方法:
package customudfs;
public class WordMapList extends EvalFunc<String> {
String filePt;
public String exec(Tuple input) throws IOException {
// code for reading file
}
我的豬腳本包含以下代碼:
DEFINE WordMapList customudfs.WordMapList('/hhh/xxx/yyy/zzz/wordMapFile.txt');
但是當我嘗試使用的代碼
exec wordMap.pig
運行腳本
它給出以下g錯誤:
[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse: Failed to generate logical plan. Nested exception: java.lang.RuntimeException: could not instantiate 'customudfs.WordMapList' with arguments 'null'