Alan Gates commented on PIG-734:

Changing maps to allow the user to specify a type would be significantly more 
work.  Also, it would be a bigger disruption in the interface, since users 
would now have to declare a key type.  We could say the type default to string 
if the user doesn't declare a type.

Nothing prevents us from eventually supporting other declared types for the 
key, with string as the default.  However, as noted in the original 
description, it will make types translations in non-java UDFs much more 
painful, so it's not clear to me that we would want to do it.

> Non-string keys in maps
> -----------------------
>                 Key: PIG-734
>                 URL: https://issues.apache.org/jira/browse/PIG-734
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Alan Gates
>            Assignee: Alan Gates
>            Priority: Minor
>             Fix For: 0.3.0
>         Attachments: PIG-734.patch
> With the addition of types to pig, maps were changed to allow any atomic type 
> to be a key.  However, in practice we do not see people using keys other than 
> strings.  And allowing multiple types is causing us issues in serializing 
> data (we have to check what every key type is) and in the design for non-java 
> UDFs (since many scripting languages include associative arrays such as 
> Perl's hash).
> So I propose we scope back maps to only have string keys.  This would be a 
> non-compatible change.  But I am not aware of anyone using non-string keys, 
> so hopefully it would have little or no impact.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to