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

Switch to Plain View
Pig, mail # user - foreach in PIG is not working.


+
yogesh.kumar13@... 2012-07-25, 18:06
+
pablomar 2012-07-25, 18:17
+
Mohammad Tariq 2012-07-25, 18:20
+
yogesh.kumar13@... 2012-07-25, 18:31
+
John Meagher 2012-07-25, 18:43
+
Mohammad Tariq 2012-07-25, 18:36
+
Mohammad Tariq 2012-07-25, 18:42
+
yogesh.kumar13@... 2012-07-25, 19:00
+
Ruslan Al-fakikh 2012-07-25, 18:11
Copy link to this message
-
Re: foreach in PIG is not working.
Mohammad Tariq 2012-07-25, 18:10
Hi Yogesh,

          As per the result of dump A, it is correct. Just see that
whatever is there in A, it's one complete chararray (Yogesh 12,).
Although you are trying to load the file as (name:chararray,
roll:int), it is going as a single field ans not (name:chararray,
roll:int). Just try to load the file properly, and you are good to go.

Regards,
    Mohammad Tariq
On Wed, Jul 25, 2012 at 11:36 PM,  <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I loaded a file to pig by command from HDFS.
>
> A=load '/HADOOP/Yogesh/demo.txt'
> as (name:chararray, roll:int);
>
> its get loaded and when i do
>
> dump A:
>
> it shows
>
> (Yogesh 12,)
> (Aashi 13,)
> (mohit 14,)
>
> Now i run another query
>
> B= foreach A generate name;
>
> to get result only names from A.
>
> but dump B; hows the same result as of    dump A; i.e
>
> (Yogesh 12,)
> (Aashi 13,)
> (mohit 14,)
>
>
> Please help and suggest.
>
> Thanks & Regards
> Yogesh Kumar
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com