python UDF version with Jython/Pig -
when python udf pig, how know version of python using? possible use specific version of python?
specifically problem in udf, need use function in math module math.erf() newly introduced in python version 2.7. have python 2.7 installed on machine , standalone python program runs fine when run in pig python udf, got this:
attributeerror: type object 'org.python.modules.math' has no attribute 'erf'
my guess jython using pre-2.7 version of python?
thanks help!
to version using can this:
myudfs.py
#!/usr/bin/python import sys @outputschema('bar: chararray') def my_func(foo): print sys.version return foo
if run script locally version printed directly stdout. see output of sys.version
when run remotely you'll have check logs on job tracker.
however, right jython being pre-2.7 (kind of). current stable version of jython right 2.5.3, version pig using. there beta version of 2.7.
Comments
Post a Comment