0
我是PIG新手,我在java中編寫了一個UDF,並複製並使用以下命令來編譯帶有pig-version.jar的java類(我正在使用pig-0.11.1和hadoop- 1.2.1)。無法使用Pig udf
>cd udfs
>java -cp $PIG_HOME/pig-0.11.1.jar UPPER.java
它促使我用下面的線
注:UPPER.java使用或覆蓋一個過時的API。 注意:使用-Xlint:deprecation重新編譯以獲取詳細信息。
我雖然它只是一個警告和建造的UDF文件夾中的jar文件
>jar -cf udfs.jar udfs
然後,我跑到下面的豬腳本some.pig
REGISTER udfs.jar;
DEFINE udfs.UPPER();
A= load 'input' using PigStorage(',') as (fname:chararray,lname:chararray,age:int);
B = foreach A generate udfs.UPPER(fname);
store B into 'some-output3' using PigStorage(',');
我跑使用命令
腳本>pig -x local some.pig
它給了我以下錯誤
Warning: $HADOOP_HOME is deprecated.
2014-02-22 12:50:28,524 [main] INFO org.apache.pig.Main - Apache Pig version 0.11.1 (r1459641) compiled Mar 22 2013, 02:13:53
2014-02-22 12:50:28,525 [main] INFO org.apache.pig.Main - Logging error messages to: /home/vamshi23/pig-area/pig_1393102228520.log
2014-02-22 12:50:28,985 [main] INFO org.apache.pig.impl.util.Utils - Default bootup file /root/.pigbootup not found
2014-02-22 12:50:29,273 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: file:///
2014-02-22 12:50:30,374 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <file some.pig, line 3, column 11> Syntax error, unexpected symbol at or near '.'
Details at logfile: /home/vamshi23/pig-area/pig_1393102228520.log
有人能幫我解決這個問題嗎?
謝謝 Vamshi
從[這篇文章](http://hortonworks.com/community/forums/topic/how-to-run-pig-script-through-command-line/),它看起來像你可以嘗試運行'豬./ some.pig' – mgamba
'some.pig'的第3行是什麼樣的? – mgamba