Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> How to redirect the Pig script summary to a file

Copy link to this message
Re: How to redirect the Pig script summary to a file
1>a.txt will redirect anything written to System.out to the file. All diagnostic operators, dump statement write to System.out and hence it will be written to a.txt.

Some of the [INFO] messages which you see in the console are from log4j which is configured to print to System.err. Following is extracted from hadoop log4j properties file. So for redirecting both stdout and stderr as prashant pointed out &>a.txt is the way to go.


-- Prasanth J

On Jun 14, 2012, at 1:17 AM, Jonathan Coveney wrote:

> Shan, while Prashant's solution works, why not just have a STORE statement
> to the local filesystem? This is the much cleaner way to do it.
> 2012/6/13 shan s <[EMAIL PROTECTED]>
>> It works, thanks.
>> I looked up http://tldp.org/LDP/abs/html/io-redirection.html but still
>> could not figure why your suggestion works.
>> If & is inclusive of 1 & 2, either 1 or 2 should have worked... But 1>a.txt
>> ignores it.
>> Curious..Could you please explain.
>> Thanks!
>> On Thu, Jun 14, 2012 at 3:51 AM, Prashant Kommireddi <[EMAIL PROTECTED]
>>> wrote:
>>> Try
>>> pig -x mapred -l logs -param $xyz=1000 pqr.pig &>a.txt
>>> On Wed, Jun 13, 2012 at 9:05 AM, shan s <[EMAIL PROTECTED]> wrote:
>>>> How do I store the pig console output  to a file.
>>>> pig -x mapred -l logs -param $xyz=1000 pqr.pig >> a.txt does not work
>> for
>>>> me. Are there any tricks to make this work?
>>>> Or is it available somewhere else.
>>>> Thanks, Prashant.