2013-05-28 100 views
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'

回答

0

你應該粘貼完整的日誌。這種情況有時是因爲一個ClassNotFoundException缺少

register ....jar ; 

但日誌與一些運氣會告訴的完整堆棧跟蹤。

相關問題