You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by wi...@thomsonreuters.com on 2011/05/02 23:00:09 UTC

ERROR 2999 when trying sample python script UDFs from UDF manual

Hi list,

I am using pig 0.8.0, about to try a python UDF.  But I can’t get the examples from
  http://pig.apache.org/docs/r0.8.0/udf.html#Python+UDFs
to work, so, presumably I have some setup problem.  Using hints from some other posts on this list, I think my CLASSPATH is OK; jython  itself at least is visible. 

The script (cut and paste from the python UDF manual):

#!/usr/bin/python

##################
# Math functions #
##################
#Square - Square of a number of any data type
@outputSchemaFunction("squareSchema")
def square(num):
  return ((num)*(num))
@schemaFunction("squareSchema")
def squareSchema(input):
  return input
[…]

My symptom (running pig -x local):
grunt> register '../mySampleLib.py' using jython as myfuncs;
<string>:1:[SyntaxWarning]: local name 'schema_def' in 'outputSchema' shadows use as global in nested scopes
<string>:1:[SyntaxWarning]: local name 'schema_def' in 'outputSchemaFunction' shadows use as global in nested scopes
<string>:1:[SyntaxWarning]: local name 'schema_def' in 'schemaFunction' shadows use as global in nested scopes
2011-05-02 16:36:51,767 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2999: Unexpected internal error. null
Details at logfile:…../pig_1304368572627.log

$ cat pig_1304368572627.log
Pig Stack Trace
---------------
ERROR 2999: Unexpected internal error. null

Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('Lexical error at line 7, column 1.  Encountered: "@" (64), after : ""', ('<iostream>', 7, 1, '@outputSchemaFunction("squareSchema")'))

Any help would be appreciated.  Thanks,

Will


William F Dowling
Sr Technical Specialist, Software Engineering
Thomson Reuters