我想使用 jython 运行 python 函数..
以本网站为例。
http://sundaycomputing.blogspot.com/2011/01/python-udfs-from-pig-scripts.html
现在当我运行脚本时(pig -f myscript.pig
它返回给我这个错误
Pig Stack Trace
---------------
ERROR 2998: Unhandled internal error. org/python/core/PyException
java.lang.NoClassDefFoundError: org/python/core/PyException
at org.apache.pig.scripting.jython.JythonScriptEngine.registerFunctions(JythonScriptEngine.java:127)
at org.apache.pig.PigServer.registerCode(PigServer.java:567)
at org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:421)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:419)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:188)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:164)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81)
at org.apache.pig.Main.run(Main.java:427)
at org.apache.pig.Main.main(Main.java:108)
Caused by: java.lang.ClassNotFoundException: org.python.core.PyException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 9 more
================================================================================
我猜是因为第一行..REGISTER udf.py USING jython AS udf;
并且我必须指定 jython 路径?(因为我在集群上运行这个代码..我不认为我已经设置了这个东西)..现在......因为我不太了解java..因此打开了python......但是我如何制作这个代码跑??
我必须在我的环境上做什么样的设置......来调试这个问题。谢谢