You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Vincent Barat <vi...@gmail.com> on 2012/06/29 14:05:34 UTC

How to extract the keys of a map ?

Hi !

I've a bag of map...

([k3#v13,k1#v11,k2#v12])
([k1#v12,k2#v22])
([k4#v31])

... and would like to extract all key names:

(k3)
(k1)
(k2)
(k1)
(k2)
(k4)

I cannot figure out how to do this (except by writting an UDF).

Any idea ?

Thanks a lot

Re: How to extract the keys of a map ?

Posted by Vincent Barat <vb...@capptain.com>.
Thank you Bill, that should do the work :-)

Le 29/06/12 18:16, Bill Graham a écrit :
> There's support for this in the trunk FYI:
> https://issues.apache.org/jira/browse/PIG-2600
>
> On Fri, Jun 29, 2012 at 5:05 AM, Vincent Barat <vi...@gmail.com>wrote:
>
>> Hi !
>>
>> I've a bag of map...
>>
>> ([k3#v13,k1#v11,k2#v12])
>> ([k1#v12,k2#v22])
>> ([k4#v31])
>>
>> ... and would like to extract all key names:
>>
>> (k3)
>> (k1)
>> (k2)
>> (k1)
>> (k2)
>> (k4)
>>
>> I cannot figure out how to do this (except by writting an UDF).
>>
>> Any idea ?
>>
>> Thanks a lot
>>
>
>

-- 
*Vincent Barat*
*CTO
* logo
*Contact info *
vbarat@capptain.com <mailto:vbarat@capptain.com%20>
www.capptain.com <http://www.capptain.com>
Cell: +33 6 15 41 15 18 	
	*Rennes Office *
Office: +33 2 99 65 69 13
10 rue Jean-Marie Duhamel
35000 Rennes
France 	
	*Paris Office *
Office: +33 1 84 06 13 85
Fax: +33 9 57 72 20 18
18 rue Tronchet
75008 Paris
France

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).



Re: How to extract the keys of a map ?

Posted by Bill Graham <bi...@gmail.com>.
There's support for this in the trunk FYI:
https://issues.apache.org/jira/browse/PIG-2600

On Fri, Jun 29, 2012 at 5:05 AM, Vincent Barat <vi...@gmail.com>wrote:

> Hi !
>
> I've a bag of map...
>
> ([k3#v13,k1#v11,k2#v12])
> ([k1#v12,k2#v22])
> ([k4#v31])
>
> ... and would like to extract all key names:
>
> (k3)
> (k1)
> (k2)
> (k1)
> (k2)
> (k4)
>
> I cannot figure out how to do this (except by writting an UDF).
>
> Any idea ?
>
> Thanks a lot
>



-- 
*Note that I'm no longer using my Yahoo! email address. Please email me at
billgraham@gmail.com going forward.*