Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> Import libraries in Jython UDFs


+
Russell Jurney 2012-07-24, 00:33
+
Norbert Burger 2012-07-24, 01:02
+
Russell Jurney 2012-07-24, 01:33
+
Aniket Mokashi 2012-07-24, 06:10
Copy link to this message
-
Re: Import libraries in Jython UDFs
ls /me/jython2.5.2/Lib/

tons of class files...
email/
This is in local mode, atm. I add this directory to my java classpath,
check.

On Mon, Jul 23, 2012 at 11:10 PM, Aniket Mokashi <[EMAIL PROTECTED]>wrote:

> jar tf jython.jar | grep email
>
> Having jar in PIG_CLASSPATH would work if you have
> https://issues.apache.org/jira/browse/MAPREDUCE-967.
>
> You can use following to debug the sys.path on tasknodes-
>
> from java.lang import System
> print "python.home "
> print System.getProperties().getProperty("python.home")
> print "java.class.path "
> print System.getProperties().getProperty("java.class.path")
> print "install.root "
> print System.getProperties().getProperty("install.root")
> print "python.home "
> print System.getProperties().getProperty("python.home")
>
> ~Aniket
>
> On Mon, Jul 23, 2012 at 6:33 PM, Russell Jurney <[EMAIL PROTECTED]
> >wrote:
>
> > No, how do I find which jar the email package is in?
> >
> > On Mon, Jul 23, 2012 at 6:02 PM, Norbert Burger <
> [EMAIL PROTECTED]
> > >wrote:
> >
> > > Have you registered the JAR in your Pig script (for local mode) and
> > > also added it to PIG_CLASSPATH (for remote mode, to get it into the
> > > distributed cache)?
> > >
> > > Norbert
> > >
> > > On Mon, Jul 23, 2012 at 8:33 PM, Russell Jurney
> > > <[EMAIL PROTECTED]> wrote:
> > > > The email package is a part of Jython, I believe:
> > > > http://www.jython.org/docs/library/email.html
> > > >
> > > > However, when I 'import email' in udfs.py, I get this error:
> > > >
> > > > 2012-07-23 17:32:51,027 [main] ERROR
> org.apache.pig.tools.grunt.Grunt -
> > > > ERROR 1121: Python Error. Traceback (most recent call last):
> > > >   File "/Users/rjurney/Collecting-Data/src/pig/udfs.py", line 1, in
> > > <module>
> > > >     import email
> > > > ImportError: No module named email
> > > >
> > > >
> > > > How do I import and use built-in packages in Jython?
> > > >
> > > > --
> > > > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]
> > > datasyndrome.com
> > >
> >
> >
> >
> > --
> > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]
> > datasyndrome.com
> >
>
>
>
> --
> "...:::Aniket:::... Quetzalco@tl"
>

--
Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
+
Chun Yang 2012-07-24, 17:00
+
Russell Jurney 2012-07-25, 00:21
+
Aniket Mokashi 2012-07-26, 00:10
+
Russell Jurney 2012-07-26, 05:16
+
Russell Jurney 2013-01-29, 19:49
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB