pig-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Martin Pampliega <jpampli...@gmail.com>
Subject Re: Problem running Pig script with Jython
Date Tue, 13 Mar 2012 13:05:55 GMT
Hi,

Sory for being repetitive but I just wanted to know if anyone had any idea
about how to get around this issue.

On Sat, Mar 3, 2012 at 8:11 PM, Juan Martin Pampliega
<jpampliega@gmail.com>wrote:

> Hi,
>
> I'm currently trying to run the following Jython script:
>
> #!/usr/bin/python
>
> from org.apache.pig.scripting import *
>
> res = Pig.compile("""loaded1 = LOAD 'hbase://tfinger' USING
> org.apache.pig.backend.hadoop.hbase.HBaseStorage('group_str:*', '-loadKey
> true') AS (id:chararray, group:map[]);dump loaded1;""").bind().runSingle()
> if res.isSuccessful():
>   print 'SUCCESS'
> else:
>   print 'FAIL'
>
> When I run it directly as a Pig script with the command "pig -x local
> [RunPigScript.py]" it works fine. When I run it through Eclipse or directly
> from the commandline with the Jython command I get the following error:
>
>
> Traceback (most recent call last):
>   File "RunPigScript.py", line 11, in <module>
>     pig = Pig.compile("""
> at org.apache.pig.scripting.Pig.getScriptContext(Pig.java:373)
>  at org.apache.pig.scripting.Pig.compile(Pig.java:158)
> at org.apache.pig.scripting.Pig.compile(Pig.java:145)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
>
> java.io.IOException: java.io.IOException: Script context is not set
>
> Any ideas on how to get around this issue? I'm running Pig 0.9.1 on local
> mode.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message