Grokbase Groups Pig user May 2012
FAQ
Hi All,
I have written some UDF in Python script (test.py). Now i want  to register this python script with PIG-GRUNT. But when i registering this script i am getting below errors.

Case 1: When i place the python script in local directory like /home/manish/python/src/test/py then
It gives me below error when register through grunt

grunt> Register '/home/manish/python/src/test.py' using jython as myfuncs;
2012-05-20 08:24:43,622 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2998: Unhandled internal error. Could not initialize class org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter
2012-05-20 08:24:43,622 [main] WARN  org.apache.pig.tools.grunt.Grunt - There is no log file to write to.
2012-05-20 08:24:43,622 [main] ERROR org.apache.pig.tools.grunt.Grunt - java.lang.NoClassDefFoundError: Could not initialize class org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter
at org.apache.pig.scripting.jython.JythonScriptEngine.registerFunctions(JythonScriptEngine.java:105)
at org.apache.pig.PigServer.registerCode(PigServer.java:518)
at org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:384)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:421)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
at org.apache.pig.Main.run(Main.java:455)
at org.apache.pig.Main.main(Main.java:107)


Case 2: I copied the python script to my HDFS (Do i need to copy ?)  then
It gives me below error


2012-05-20 08:37:07,310 [main] ERROR org.apache.pig.tools.grunt.Grunt - org.apache.pig.impl.logicalLayer.FrontendException: ERROR 4002: Can't read file: /user/manish/input/test.py
at org.apache.pig.PigServer.registerCode(PigServer.java:513)
at org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:384)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:421)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
at org.apache.pig.Main.run(Main.java:455)
at org.apache.pig.Main.main(Main.java:107)

After setting class path and hadoop conf directory I am not sure what other settings are required for jython to run.

Thank You,
Manish

Search Discussions

  • Jagat at May 20, 2012 at 3:27 am
    Hi

    Are you using jython 2.5 as pig works with that.

    -----------
    Sent from Mobile , short and crisp.
    On 20-May-2012 8:49 AM, "Manish Bhoge" wrote:

    Hi All,
    I have written some UDF in Python script (test.py). Now i want to
    register this python script with PIG-GRUNT. But when i registering this
    script i am getting below errors.

    Case 1: When i place the python script in local directory like
    /home/manish/python/src/test/py then
    It gives me below error when register through grunt

    grunt> Register '/home/manish/python/src/test.py' using jython as myfuncs;
    2012-05-20 08:24:43,622 [main] ERROR org.apache.pig.tools.grunt.Grunt -
    ERROR 2998: Unhandled internal error. Could not initialize class
    org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter
    2012-05-20 08:24:43,622 [main] WARN org.apache.pig.tools.grunt.Grunt -
    There is no log file to write to.
    2012-05-20 08:24:43,622 [main] ERROR org.apache.pig.tools.grunt.Grunt -
    java.lang.NoClassDefFoundError: Could not initialize class
    org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter
    at
    org.apache.pig.scripting.jython.JythonScriptEngine.registerFunctions(JythonScriptEngine.java:105)
    at org.apache.pig.PigServer.registerCode(PigServer.java:518)
    at
    org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:384)
    at
    org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:421)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
    at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
    at org.apache.pig.Main.run(Main.java:455)
    at org.apache.pig.Main.main(Main.java:107)


    Case 2: I copied the python script to my HDFS (Do i need to copy ?) then
    It gives me below error


    2012-05-20 08:37:07,310 [main] ERROR org.apache.pig.tools.grunt.Grunt -
    org.apache.pig.impl.logicalLayer.FrontendException: ERROR 4002: Can't read
    file: /user/manish/input/test.py
    at org.apache.pig.PigServer.registerCode(PigServer.java:513)
    at
    org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:384)
    at
    org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:421)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
    at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
    at org.apache.pig.Main.run(Main.java:455)
    at org.apache.pig.Main.main(Main.java:107)

    After setting class path and hadoop conf directory I am not sure what
    other settings are required for jython to run.

    Thank You,
    Manish
  • Manish Bhoge at May 20, 2012 at 3:43 am
    I think 2.6.


    ________________________________
    From: Jagat <jagatsingh@gmail.com>
    To: Manish Bhoge <manishbhoge@rocketmail.com>; user@pig.apache.org
    Sent: Sunday, May 20, 2012 8:56 AM
    Subject: Re: Jython Interpretor error

    Hi

    Are you using jython 2.5 as pig works with that.

    -----------
    Sent from Mobile , short and crisp.
    On 20-May-2012 8:49 AM, "Manish Bhoge" wrote:

    Hi All,
    I have written some UDF in Python script (test.py). Now i want  to
    register this python script with PIG-GRUNT. But when i registering this
    script i am getting below errors.

    Case 1: When i place the python script in local directory like
    /home/manish/python/src/test/py then
    It gives me below error when register through grunt

    grunt> Register '/home/manish/python/src/test.py' using jython as myfuncs;
    2012-05-20 08:24:43,622 [main] ERROR org.apache.pig.tools.grunt.Grunt -
    ERROR 2998: Unhandled internal error. Could not initialize class
    org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter
    2012-05-20 08:24:43,622 [main] WARN  org.apache.pig.tools.grunt.Grunt -
    There is no log file to write to.
    2012-05-20 08:24:43,622 [main] ERROR org.apache.pig.tools.grunt.Grunt -
    java.lang.NoClassDefFoundError: Could not initialize class
    org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter
    at
    org.apache.pig.scripting.jython.JythonScriptEngine.registerFunctions(JythonScriptEngine.java:105)
    at org.apache.pig.PigServer.registerCode(PigServer.java:518)
    at
    org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:384)
    at
    org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:421)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
    at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
    at org.apache.pig.Main.run(Main.java:455)
    at org.apache.pig.Main.main(Main.java:107)


    Case 2: I copied the python script to my HDFS (Do i need to copy ?)  then
    It gives me below error


    2012-05-20 08:37:07,310 [main] ERROR org.apache.pig.tools.grunt.Grunt -
    org.apache.pig.impl.logicalLayer.FrontendException: ERROR 4002: Can't read
    file: /user/manish/input/test.py
    at org.apache.pig.PigServer.registerCode(PigServer.java:513)
    at
    org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:384)
    at
    org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:421)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
    at
    org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
    at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
    at org.apache.pig.Main.run(Main.java:455)
    at org.apache.pig.Main.main(Main.java:107)

    After setting class path and hadoop conf directory I am not sure what
    other settings are required for jython to run.

    Thank You,
    Manish

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedMay 20, '12 at 3:19a
activeMay 20, '12 at 3:43a
posts3
users2
websitepig.apache.org

2 users in discussion

Manish Bhoge: 2 posts Jagat: 1 post

People

Translate

site design / logo © 2022 Grokbase