[jira] [Commented] (PIG-4405) Adding 'map[]' support to mock/Storage
[ https://issues.apache.org/jira/browse/PIG-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14654920#comment-14654920 ] Niels Basjes commented on PIG-4405: --- I agree, we should go for the consistency. I was unaware of the 'bag' syntax you showed. > 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)
[jira] [Commented] (PIG-4405) Adding 'map[]' support to mock/Storage
[ https://issues.apache.org/jira/browse/PIG-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14653973#comment-14653973 ] Daniel Dai commented on PIG-4405: - Bag has the same issue. Take a sample from existing code: {code} data.set("foo", "myBag:bag{t:(l:chararray)}", tuple(bag(tuple("a", "b"), tuple("c", "d"), tuple("e", "f"; {code} Agree approach 1 is clear, but bag takes approach 2, we shall do it consistently, right? > 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)
[jira] [Commented] (PIG-4405) Adding 'map[]' support to mock/Storage
[ 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 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)
[jira] [Commented] (PIG-4405) Adding 'map[]' support to mock/Storage
[ https://issues.apache.org/jira/browse/PIG-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14644574#comment-14644574 ] Alan Gates commented on PIG-4405: - Based on the way it's used I'm surprised to see the HashMap wrapped in a Tuple. That will work because Pig allows nesting of types, but it doesn't seem necessary for what you're trying to do. > 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)
[jira] [Commented] (PIG-4405) Adding 'map[]' support to mock/Storage
[ https://issues.apache.org/jira/browse/PIG-4405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14303189#comment-14303189 ] Niels Basjes commented on PIG-4405: --- Sure, I'll give it a go. > 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.15.0 > > > 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)