You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Iman Elghandour <ie...@yahoo.com> on 2009/03/19 17:36:38 UTC

Split with no if condition

Hello,
I am new to Pig and I am trying to figure out how to do this. I have noticed some examples that look like:

Split A into B, C;

I understand that these examples are probably about adding such implicit splits. But I would like to do it explicitly in my pig script. Is there a way to do it without the if condition. Or Is there a way to do "if true"?

Thanks,
Iman.



      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at
http://ca.toolbar.yahoo.com.

RE: Split with no if condition

Posted by Santhosh Srinivasan <sm...@yahoo-inc.com>.
Split A into  B if 1 == 1, C if 1 ==1;

Santhosh 

-----Original Message-----
From: Iman Elghandour [mailto:ielghand@yahoo.com] 
Sent: Thursday, March 19, 2009 9:37 AM
To: pig-user@hadoop.apache.org
Subject: Split with no if condition

Hello,
I am new to Pig and I am trying to figure out how to do this. I have
noticed some examples that look like:

Split A into B, C;

I understand that these examples are probably about adding such implicit
splits. But I would like to do it explicitly in my pig script. Is there
a way to do it without the if condition. Or Is there a way to do "if
true"?

Thanks,
Iman.



      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark
your favourite sites. Download it now at
http://ca.toolbar.yahoo.com.

Re: Split with no if condition

Posted by Kevin Weil <ke...@gmail.com>.
Iman,

What exactly are you trying to do?  If you want to just copy A into another
alias, you can say

B = foreach A generate *;

The parser (at least in trunk as of about 3 weeks ago) doesn't like the more
compact B = A, but the above gets the job done.  Is that what you were
after?

Kevin

On Thu, Mar 19, 2009 at 9:36 AM, Iman Elghandour <ie...@yahoo.com> wrote:

> Hello,
> I am new to Pig and I am trying to figure out how to do this. I have
> noticed some examples that look like:
>
> Split A into B, C;
>
> I understand that these examples are probably about adding such implicit
> splits. But I would like to do it explicitly in my pig script. Is there a
> way to do it without the if condition. Or Is there a way to do "if true"?
>
> Thanks,
> Iman.
>
>
>
>      __________________________________________________________________
> Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
> favourite sites. Download it now at
> http://ca.toolbar.yahoo.com.
>