[ 
https://issues.apache.org/jira/browse/PIG-2600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233850#comment-13233850
 ] 

Jonathan Coveney commented on PIG-2600:
---------------------------------------

Prashant,

Thanks for working on this! As far as Inversemap, I don't know if I like the 
semantic that if there are multiple values, you just get essentially a random 
Key. I think you should get a Tuple or Bag of or List whatever of Keys that 
correspond... the assumption is that values can appear more than once.

Open to debate though :)

Another option on the "inversmap only works on Map<String,String>" front would 
be that, if given Map<String, T>" it converts T to a string, which I think 
isn't a bad idea. Maybe that could be a constructor option, and the default is 
an error.
                
> Better Map support
> ------------------
>
>                 Key: PIG-2600
>                 URL: https://issues.apache.org/jira/browse/PIG-2600
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Jonathan Coveney
>             Fix For: 0.11
>
>         Attachments: PIG-2600.patch, PIG-2600_2.patch
>
>
> It would be nice if Pig played better with Maps. To that end, I'd like to add 
> a lot of utility around Maps.
> - TOBAG should take a Map and output {(key, value)}
> - TOMAP should take a Bag in that same form and make a map.
> - KEYSET should return the set of keys.
> - VALUESET should return the set of values.
> - VALUELIST should return the List of values (no deduping).
> - INVERSEMAP would return a Map of values => the set of keys that refer to 
> that Key
> This would all be pretty easy. A more substantial piece of work would be to 
> make Pig support non-String keys (this is especially an issue since UDFs and 
> whatnot probably assume that they are all Integers). Not sure if it is worth 
> it.
> I'd love to hear other things that would be useful for people!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to