Pig get confused if map value is not bytearray
----------------------------------------------

                 Key: PIG-1703
                 URL: https://issues.apache.org/jira/browse/PIG-1703
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.8.0
            Reporter: Daniel Dai
            Assignee: Daniel Dai
             Fix For: 0.9.0


It is the same nature of 
[PIG-999|https://issues.apache.org/jira/browse/PIG-999]. Just adding another 
test case:

{code}
a = load ':INPATH:/singlefile/studenttab10k' as (name: chararray, age: int, 
gpa: float);
sds = load ':INPATH:/somefile' using SomeLoader() as (s:map[], m:map[],
l:map[]);
views = FOREACH sds GENERATE s#'srcpvid' as srcpvid, flatten(l#'viewinfo') as 
viewinfo;
views1 = FILTER views BY srcpvid == '1234';
views2 = FILTER views1 BY (viewinfo#'it' EQ '25');
map_scalar = limit views2 1;
z = foreach a generate name, age+(double)map_scalar.viewinfo#'it' as some_sum;
store z into ':OUTPATH:.2';
{code}

Here l is a map of bags of maps. flatten(l#'viewinfo') suppose to get maps. 
However, internally Pig track all map key as bytearray. In the scalar case, 
ReadScalar will give bytearray as outputschema, but it is actually a map. What 
Pig does is to Stringize map, and then convert string back into map, which end 
up with nulls.  

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