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

hc busy commented on PIG-1016:
------------------------------

Thejas, great point! 

Run time detection of type does use more time at run time and require more 
discipline to use. 

But I'd like to point out that the original implementation seemed to have 
allowed for this in PigStorage. The change to reduce the types that can be 
stored in the value of a map seems to reduce functionality of Pig. 

I guess the one case where I want to use map is when I have a sparse tuple, 
that I don't want to type in a type for each of the many fields. Because if I 
went to that trouble, I'd just write java code, or use something where schema 
is statically defined and stored. 

say, for simple example, self join of one row 

{{\[data1#\[score#15l,unique_id#100\],data2#\[score#15,foreign#00100\]\]}} 

{code} 
B = join A by m#data1#unique_id, A by m#data2#foriegn 
C = Filter B by $0#score=$1#score 
{code} 

I'd think something like this should work without me typing in the entire type 
structure. 


Also, what happens when BinStorage returns a map with value that isn't a 
bytearray, does the comparison fail? 


> Reading in map data seems broken
> --------------------------------
>
>                 Key: PIG-1016
>                 URL: https://issues.apache.org/jira/browse/PIG-1016
>             Project: Pig
>          Issue Type: Improvement
>          Components: data
>    Affects Versions: 0.4.0
>            Reporter: hc busy
>             Fix For: 0.5.0
>
>         Attachments: PIG-1016.patch
>
>
> Hi, I'm trying to load a map that has a tuple for value. The read fails in 
> 0.4.0 because of a misconfiguration in the parser. Where as in almost all 
> documentation it is stated that value of the map can be any time.
> I've attached a patch that allows us to read in complex objects as value as 
> documented. I've done simple verification of loading in maps with tuple/map 
> values and writing them back out using LOAD and STORE. All seems to work fine.

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