[
https://issues.apache.org/jira/browse/PIG-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14645023#comment-14645023
]
Niels Basjes commented on PIG-4405:
-----------------------------------
The 'Data.set' methods require either a {{Collection<Tuple> data}} or a
{{Tuple... data}}.
Changing all of those functions to explicitly accept a 'Map' didn't seem the
right thing to do here.
So I could either let the 'map' function return a {{Tuple}}
So a usage of this would look like this:
data.set("foo",
tuple("a"),
tuple("b"),
tuple("c"),
map("d","e", "f","g")
);
or require the developer to explicitly wrap it each and every time.
data.set("foo",
tuple("a"),
tuple("b"),
tuple("c"),
tuple(map("d","e", "f","g"))
);
I chose the first one because it resulted in the easiest to read application
code (I expect mostly junit tests).
Please advise on a better solution direction.
> Adding 'map[]' support to mock/Storage
> --------------------------------------
>
> Key: PIG-4405
> URL: https://issues.apache.org/jira/browse/PIG-4405
> Project: Pig
> Issue Type: Improvement
> Affects Versions: 0.14.0
> Reporter: Niels Basjes
> Assignee: Niels Basjes
> Fix For: 0.16.0
>
> Attachments: PIG-4405-20150723.patch
>
>
> The mock/Storage contains convenience methods for creating a bag and a tuple
> when doing unit tests. Pig has however 3 complex data types ( see
> http://pig.apache.org/docs/r0.14.0/basic.html#Simple+and+Complex ) and the
> third one (the map) is not yet present in such a convenience method.
> Feature request: Add such a method to facilitate testing map[] output better.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)