Skip to content Skip to sidebar Skip to footer

Python Udf Version With Jython/pig

When I do Python UDF with Pig, how do we know which version of Python it is using? Is it possible to use a specific version of Python? Specifically my problem is in my UDF, I need

Solution 1:

To get the version you are using you can do this:

myUDFS.py

#!/usr/bin/pythonimport sys

@outputSchema('bar: chararray')defmy_func(foo):
    print sys.version
    return foo

If you run the script locally then the version will be printed directly to stdout. To see the output of sys.version when you run it remotely you'll have to check the logs on the job tracker.

However, you are right about Jython being pre-2.7 (kind of). The current stable version of Jython right now is 2.5.3, so this is the version that Pig is using. There is a beta version of 2.7.

Post a Comment for "Python Udf Version With Jython/pig"