|
|
-
How to create an empty alias
Kevin LION 2012-10-18, 16:15
Hello,
I've a script which group lot of alias and is doing some operation on it. But it can happen that I don't need one of this alias. To don't change my code, I would like to create an empty alias. How can I do that ?
Actually my code is like that : A = LOAD A AS (id, a1, a2); B = LOAD A AS (id, b1, b2); C = LOAD A AS (id, c1, c2); GROUP = COGROUP A BY id, B BY id, C BY id; GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL);
And I would like to do something like that : A = LOAD A AS (id, a1, a2); B = LOAD A AS (id, b1, b2); *C = LOAD NULL AS (id, c1, c2); <- Generate an empty alias with column id, c1, c2;* GROUP = COGROUP A BY id, B BY id, C BY id; GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL);
Thanks, -- *Kevin Lion** * [image: logo]
* Contact info * [EMAIL PROTECTED] <[EMAIL PROTECTED]> www.capptain.com * Rennes Office * Office: +33 2 99 65 69 13 10 rue Duhamel 35000 Rennes
* Paris Office * Office: +33 1 34 43 28 89 18 rue Tronchet 75008 Paris IMPORTANT NOTICE – UBIKOD and CAPPTAIN are registered trademarks of UBIKOD S.A.R.L., all copyrights are reserved. The contents of this email and attachments are confidential and may be subject to legal privilege and/or protected by copyright. Copying or communicating any part of it to others is prohibited and may be unlawful. If you are not the intended recipient you must not use, copy, distribute or rely on this email and should please return it immediately or notify us by telephone. At present the integrity of email across the Internet cannot be guaranteed. Therefore UBIKOD S.A.R.L. will not accept liability for any claims arising as a result of the use of this medium for transmissions by or to UBIKOD S.A.R.L.. UBIKOD S.A.R.L. may exercise any of its rights under relevant law, to monitor the content of all electronic communications. You should therefore be aware that this communication and any responses might have been monitored, and may be accessed by UBIKOD S.A.R.L. The views expressed in this document are that of the individual and may not necessarily constitute or imply its endorsement or recommendation by UBIKOD S.A.R.L. The content of this electronic mail may be subject to the confidentiality terms of a "Non-Disclosure Agreement" (NDA).
+
Kevin LION 2012-10-18, 16:15
-
Re: How to create an empty alias
Vitalii Tymchyshyn 2012-11-07, 04:04
Sorry, for late response. In case you still need this. You can try to read from file:/dev/null This should work for most formats.
2012/10/18 Kevin LION <[EMAIL PROTECTED]>
> Hello, > > I've a script which group lot of alias and is doing some operation on it. > But it can happen that I don't need one of this alias. To don't change my > code, I would like to create an empty alias. How can I do that ? > > Actually my code is like that : > A = LOAD A AS (id, a1, a2); > B = LOAD A AS (id, b1, b2); > C = LOAD A AS (id, c1, c2); > GROUP = COGROUP A BY id, B BY id, C BY id; > GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; > OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL); > > And I would like to do something like that : > A = LOAD A AS (id, a1, a2); > B = LOAD A AS (id, b1, b2); > *C = LOAD NULL AS (id, c1, c2); <- Generate an empty alias with column id, > c1, c2;* > GROUP = COGROUP A BY id, B BY id, C BY id; > GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; > OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL); > -- Best regards, Vitalii Tymchyshyn
+
Vitalii Tymchyshyn 2012-11-07, 04:04
-
RE: How to create an empty alias
yogesh dhari 2012-11-07, 18:32
Just tell us what issue you are facing and what output do you want?
give a demo data and tell what kind of output you want.
Instead of posting query post the demo data and what outcome you do want..
Regards Yogesh Kumar
> Date: Tue, 6 Nov 2012 23:04:15 -0500 > Subject: Re: How to create an empty alias > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > > Sorry, for late response. In case you still need this. > You can try to read from file:/dev/null > This should work for most formats. > > 2012/10/18 Kevin LION <[EMAIL PROTECTED]> > > > Hello, > > > > I've a script which group lot of alias and is doing some operation on it. > > But it can happen that I don't need one of this alias. To don't change my > > code, I would like to create an empty alias. How can I do that ? > > > > Actually my code is like that : > > A = LOAD A AS (id, a1, a2); > > B = LOAD A AS (id, b1, b2); > > C = LOAD A AS (id, c1, c2); > > GROUP = COGROUP A BY id, B BY id, C BY id; > > GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; > > OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL); > > > > And I would like to do something like that : > > A = LOAD A AS (id, a1, a2); > > B = LOAD A AS (id, b1, b2); > > *C = LOAD NULL AS (id, c1, c2); <- Generate an empty alias with column id, > > c1, c2;* > > GROUP = COGROUP A BY id, B BY id, C BY id; > > GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; > > OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL); > > > -- > Best regards, > Vitalii Tymchyshyn
+
yogesh dhari 2012-11-07, 18:32
-
RE: How to create an empty alias
yogesh dhari 2012-11-08, 03:42
Sorry Guys, that last mail sent by mistake.
That mail doesn't belongs here. Please ignore it
Regards Yogesh Kumar
> From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: RE: How to create an empty alias > Date: Thu, 8 Nov 2012 00:02:43 +0530 > > > Just tell us what issue you are facing and what output do you want? > > give a demo data and tell what kind of output you want. > > Instead of posting query post the demo data and what outcome you do want.. > > Regards > Yogesh Kumar > > > Date: Tue, 6 Nov 2012 23:04:15 -0500 > > Subject: Re: How to create an empty alias > > From: [EMAIL PROTECTED] > > To: [EMAIL PROTECTED] > > > > Sorry, for late response. In case you still need this. > > You can try to read from file:/dev/null > > This should work for most formats. > > > > 2012/10/18 Kevin LION <[EMAIL PROTECTED]> > > > > > Hello, > > > > > > I've a script which group lot of alias and is doing some operation on it. > > > But it can happen that I don't need one of this alias. To don't change my > > > code, I would like to create an empty alias. How can I do that ? > > > > > > Actually my code is like that : > > > A = LOAD A AS (id, a1, a2); > > > B = LOAD A AS (id, b1, b2); > > > C = LOAD A AS (id, c1, c2); > > > GROUP = COGROUP A BY id, B BY id, C BY id; > > > GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; > > > OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL); > > > > > > And I would like to do something like that : > > > A = LOAD A AS (id, a1, a2); > > > B = LOAD A AS (id, b1, b2); > > > *C = LOAD NULL AS (id, c1, c2); <- Generate an empty alias with column id, > > > c1, c2;* > > > GROUP = COGROUP A BY id, B BY id, C BY id; > > > GROUP2 = FOREACH GROUP GENERATE TOTUPLE(A, B, C) AS ALL; > > > OPERATION = FOREACH GROUP2 GENERATE MyUDF(ALL); > > > > > -- > > Best regards, > > Vitalii Tymchyshyn >
+
yogesh dhari 2012-11-08, 03:42
|
|