Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Python UDF

I try to follow the example on http://pig.apache.org/docs/r0.8.1/udf.html#Python+UDFs for Python UDF, but I got the following error

* My command:
pig -x local ptest.pig

* error message
2011-10-06 15:15:19,995 [main] INFO  org.apache.pig.Main - Logging error messages to: /home/dli/pigExamples/PythonUDFs/pig_1317939319904.log
2011-10-06 15:15:20,485 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: file:///
2011-10-06 15:15:20,956 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2998: Unhandled internal error. org/python/util/PythonInterpreter
Details at logfile: /home/dli/pigExamples/PythonUDFs/pig_1317939319904.log

* My pig code
Register 'test.py' using jython as myfuncs;

a = load 'a.dat' as (v:chararray);
b = foreach a generate v, myfuncs.helloworld();
dump b;

* test.py
def helloworld():
   return 'Hello, World'

I wonder what's the problem. My pig version is
pig --version
Apache Pig version 0.8.0-SNAPSHOT (r1085617)