|
Russell Jurney
2012-04-28, 23:21
Prashant Kommireddi
2012-04-29, 01:03
Russell Jurney
2012-04-29, 01:12
Prashant Kommireddi
2012-04-29, 01:18
Russell Jurney
2012-04-29, 01:22
Prashant Kommireddi
2012-04-29, 01:58
Ashish Gite
2012-04-29, 06:18
Russell Jurney
2012-04-29, 06:25
Dmitriy Ryaboy
2012-04-29, 23:24
|
-
Importing register/define statements?Russell Jurney 2012-04-28, 23:21
I have a lot of pig stuff like this:
/* Load Avro jars and define shortcut */ register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); I hate to paste it in every file. Is there a way to load this stuff in one line, like a macro? Macros can't register. -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
-
Re: Importing register/define statements?Prashant Kommireddi 2012-04-29, 01:03
In pig 0.10 you can glob these jars in your pig script.
Register path/*.jar Sent from my iPhone On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]> wrote: > I have a lot of pig stuff like this: > > /* Load Avro jars and define shortcut */ > register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar > register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar > register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar > register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar > register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar > > define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); > > > I hate to paste it in every file. Is there a way to load this stuff in one > line, like a macro? Macros can't register. > > -- > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
-
Re: Importing register/define statements?Russell Jurney 2012-04-29, 01:12
There are tons more jars in that directory that I don't need. Is there a
reason to be concerned about loading all of them? On Sat, Apr 28, 2012 at 6:03 PM, Prashant Kommireddi <[EMAIL PROTECTED]>wrote: > In pig 0.10 you can glob these jars in your pig script. > > Register path/*.jar > > Sent from my iPhone > > On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]> > wrote: > > > I have a lot of pig stuff like this: > > > > /* Load Avro jars and define shortcut */ > > register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar > > register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar > > register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar > > register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar > > register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar > > > > define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); > > > > > > I hate to paste it in every file. Is there a way to load this stuff in > one > > line, like a macro? Macros can't register. > > > > -- > > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] > datasyndrome.com > -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
-
Re: Importing register/define statements?Prashant Kommireddi 2012-04-29, 01:18
You would ideally not want to load jars you don't use. Can you create
a directory containing jars specific to this script? On Apr 28, 2012, at 6:13 PM, Russell Jurney <[EMAIL PROTECTED]> wrote: > There are tons more jars in that directory that I don't need. Is there a > reason to be concerned about loading all of them? > > On Sat, Apr 28, 2012 at 6:03 PM, Prashant Kommireddi <[EMAIL PROTECTED]>wrote: > >> In pig 0.10 you can glob these jars in your pig script. >> >> Register path/*.jar >> >> Sent from my iPhone >> >> On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]> >> wrote: >> >>> I have a lot of pig stuff like this: >>> >>> /* Load Avro jars and define shortcut */ >>> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar >>> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar >>> register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar >>> register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar >>> register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar >>> >>> define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); >>> >>> >>> I hate to paste it in every file. Is there a way to load this stuff in >> one >>> line, like a macro? Macros can't register. >>> >>> -- >>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] >> datasyndrome.com >> > > > > -- > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
-
Re: Importing register/define statements?Russell Jurney 2012-04-29, 01:22
That makes sense. I can copy the jars and organize them that way.
Is it possible to zip multiple jars into one jar, and then load that jar? On Sat, Apr 28, 2012 at 6:18 PM, Prashant Kommireddi <[EMAIL PROTECTED]>wrote: > You would ideally not want to load jars you don't use. Can you create > a directory containing jars specific to this script? > > On Apr 28, 2012, at 6:13 PM, Russell Jurney <[EMAIL PROTECTED]> > wrote: > > > There are tons more jars in that directory that I don't need. Is there a > > reason to be concerned about loading all of them? > > > > On Sat, Apr 28, 2012 at 6:03 PM, Prashant Kommireddi < > [EMAIL PROTECTED]>wrote: > > > >> In pig 0.10 you can glob these jars in your pig script. > >> > >> Register path/*.jar > >> > >> Sent from my iPhone > >> > >> On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]> > >> wrote: > >> > >>> I have a lot of pig stuff like this: > >>> > >>> /* Load Avro jars and define shortcut */ > >>> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar > >>> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar > >>> register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar > >>> register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar > >>> register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar > >>> > >>> define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); > >>> > >>> > >>> I hate to paste it in every file. Is there a way to load this stuff in > >> one > >>> line, like a macro? Macros can't register. > >>> > >>> -- > >>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] > >> datasyndrome.com > >> > > > > > > > > -- > > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] > datasyndrome.com > -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
-
Re: Importing register/define statements?Prashant Kommireddi 2012-04-29, 01:58
Yes, you can create a single jar (I have used ant targets previously,
there should be some tools available). Sent from my iPhone On Apr 28, 2012, at 6:23 PM, Russell Jurney <[EMAIL PROTECTED]> wrote: > That makes sense. I can copy the jars and organize them that way. > > Is it possible to zip multiple jars into one jar, and then load that jar? > > On Sat, Apr 28, 2012 at 6:18 PM, Prashant Kommireddi <[EMAIL PROTECTED]>wrote: > >> You would ideally not want to load jars you don't use. Can you create >> a directory containing jars specific to this script? >> >> On Apr 28, 2012, at 6:13 PM, Russell Jurney <[EMAIL PROTECTED]> >> wrote: >> >>> There are tons more jars in that directory that I don't need. Is there a >>> reason to be concerned about loading all of them? >>> >>> On Sat, Apr 28, 2012 at 6:03 PM, Prashant Kommireddi < >> [EMAIL PROTECTED]>wrote: >>> >>>> In pig 0.10 you can glob these jars in your pig script. >>>> >>>> Register path/*.jar >>>> >>>> Sent from my iPhone >>>> >>>> On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]> >>>> wrote: >>>> >>>>> I have a lot of pig stuff like this: >>>>> >>>>> /* Load Avro jars and define shortcut */ >>>>> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar >>>>> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar >>>>> register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar >>>>> register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar >>>>> register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar >>>>> >>>>> define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); >>>>> >>>>> >>>>> I hate to paste it in every file. Is there a way to load this stuff in >>>> one >>>>> line, like a macro? Macros can't register. >>>>> >>>>> -- >>>>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] >>>> datasyndrome.com >>>> >>> >>> >>> >>> -- >>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] >> datasyndrome.com >> > > > > -- > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com
-
Re: Importing register/define statements?Ashish Gite 2012-04-29, 06:18
Other option would be:
import '../path/to/common.pig'; This allows reusing pig code. So one can keep all the register, define etc in one file & keep including it in other pig scripts. Works pig 0.9.x onwards. Sent from Mobile
-
Re: Importing register/define statements?Russell Jurney 2012-04-29, 06:25
I tried that, it doesn't work. Docs indicate you can't register in a macro,
which is what import is. Russell Jurney http://datasyndrome.com On Apr 28, 2012, at 11:18 PM, Ashish Gite <[EMAIL PROTECTED]> wrote: Other option would be: import '../path/to/common.pig'; This allows reusing pig code. So one can keep all the register, define etc in one file & keep including it in other pig scripts. Works pig 0.9.x onwards. Sent from Mobile ------------------------------ * From: * Russell Jurney <[EMAIL PROTECTED]>; * To: * <[EMAIL PROTECTED]>; * Subject: * Re: Importing register/define statements? * Sent: * Sun, Apr 29, 2012 1:22:46 AM That makes sense. I can copy the jars and organize them that way. Is it possible to zip multiple jars into one jar, and then load that jar? On Sat, Apr 28, 2012 at 6:18 PM, Prashant Kommireddi <[EMAIL PROTECTED]<javascript:return> >wrote: > You would ideally not want to load jars you don't use. Can you create > a directory containing jars specific to this script? > > On Apr 28, 2012, at 6:13 PM, Russell Jurney <[EMAIL PROTECTED]<javascript:return> > > wrote: > > > There are tons more jars in that directory that I don't need. Is there a > > reason to be concerned about loading all of them? > > > > On Sat, Apr 28, 2012 at 6:03 PM, Prashant Kommireddi < > [EMAIL PROTECTED] <javascript:return>>wrote: > > > >> In pig 0.10 you can glob these jars in your pig script. > >> > >> Register path/*.jar > >> > >> Sent from my iPhone > >> > >> On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]<javascript:return> > > >> wrote: > >> > >>> I have a lot of pig stuff like this: > >>> > >>> /* Load Avro jars and define shortcut */ > >>> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar > >>> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar > >>> register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar > >>> register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar > >>> register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar > >>> > >>> define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage(); > >>> > >>> > >>> I hate to paste it in every file. Is there a way to load this stuff in > >> one > >>> line, like a macro? Macros can't register. > >>> > >>> -- > >>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]<javascript:return> > >> datasyndrome.com > >> > > > > > > > > -- > > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]<javascript:return> > datasyndrome.com > -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]<javascript:return> datasyndrome.com
-
Re: Importing register/define statements?Dmitriy Ryaboy 2012-04-29, 23:24
What happens if you s/import/exec/ ?
D On Sat, Apr 28, 2012 at 11:25 PM, Russell Jurney <[EMAIL PROTECTED]> wrote: > I tried that, it doesn't work. Docs indicate you can't register in a macro, > which is what import is. > > Russell Jurney http://datasyndrome.com > > On Apr 28, 2012, at 11:18 PM, Ashish Gite <[EMAIL PROTECTED]> wrote: > > Other option would be: > > import '../path/to/common.pig'; > > This allows reusing pig code. So one can keep all the register, define etc > in one file & keep including it in other pig scripts. Works pig 0.9.x > onwards. > > Sent from Mobile > > ------------------------------ > * From: * Russell Jurney <[EMAIL PROTECTED]>; > * To: * <[EMAIL PROTECTED]>; > * Subject: * Re: Importing register/define statements? > * Sent: * Sun, Apr 29, 2012 1:22:46 AM > > That makes sense. I can copy the jars and organize them that way. > > Is it possible to zip multiple jars into one jar, and then load that jar? > > On Sat, Apr 28, 2012 at 6:18 PM, Prashant Kommireddi > <[EMAIL PROTECTED]<javascript:return> >>wrote: > >> You would ideally not want to load jars you don't use. Can you create >> a directory containing jars specific to this script? >> >> On Apr 28, 2012, at 6:13 PM, Russell Jurney <[EMAIL PROTECTED]<javascript:return> >> >> wrote: >> >> > There are tons more jars in that directory that I don't need. Is there a >> > reason to be concerned about loading all of them? >> > >> > On Sat, Apr 28, 2012 at 6:03 PM, Prashant Kommireddi < >> [EMAIL PROTECTED] <javascript:return>>wrote: >> > >> >> In pig 0.10 you can glob these jars in your pig script. >> >> >> >> Register path/*.jar >> >> >> >> Sent from my iPhone >> >> >> >> On Apr 28, 2012, at 4:22 PM, Russell Jurney <[EMAIL PROTECTED]<javascript:return> >> >> >> wrote: >> >> >> >>> I have a lot of pig stuff like this: >> >>> >> >>> /* Load Avro jars and define shortcut */ >> >>> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar >> >>> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar >> >>> register /me/pig/build/ivy/lib/Pig/jackson-core-asl-1.7.3.jar >> >>> register /me/pig/build/ivy/lib/Pig/jackson-mapper-asl-1.7.3.jar >> >>> register /me/pig/build/ivy/lib/Pig/joda-time-1.6.jar >> >>> >> >>> define AvroStorage > org.apache.pig.piggybank.storage.avro.AvroStorage(); >> >>> >> >>> >> >>> I hate to paste it in every file. Is there a way to load this stuff in >> >> one >> >>> line, like a macro? Macros can't register. >> >>> >> >>> -- >> >>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]<javascript:return> >> >> datasyndrome.com >> >> >> > >> > >> > >> > -- >> > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]<javascript:return> >> datasyndrome.com >> > > > > -- > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]<javascript:return> > datasyndrome.com |