well... I have this data:
[key#'1', b#'2', c#'3', key2#5]
[key#'2', b#'i', c#'m', key2#6]
[key#'3', b#'j', c#'n', key2#7]
[key#'4', b#'k', c#'o', key2#8]
and I run
A= load 'simple_map.data' as (m:map[]);
A2= FOREACH A generate (int)(m#'key2') as key, m;
dump A2
returning
(,[ key2#5, b#'2',key#'1', c#'3'])
(,[ key2#6, b#'i',key#'2', c#'m'])
(,[ key2#7, b#'j',key#'3', c#'n'])
(,[ key2#8, b#'k',key#'4', c#'o'])
I'm looking at PIG-613, but I guess the title is misleading. None of the
casting of value of map works in 0.5.0 I guess if PIG-613 works as
described, I would be in okay shape, because I would be able to cast again
and again using separate aliases...
PIG-613 not what I meant for pig-1016, but it seems to get me the feature
I
want.
On Tue, Jan 5, 2010 at 7:00 PM, Guy Bayes <[email protected]> wrote:
thanks Thejas, that thread helped out immensely.
Also great to see Santhosh remembered that nasty PIG 880 bug with the
type
inference causing an integer overflow, which coincidentally enough I also
got stung by at one time.
in the meantime, while I would love to have complex map datatypes,
certainly
can be worked around using other methods
appreciate the prompt response
Guy
On Tue, Jan 5, 2010 at 10:38 AM, Thejas Nair <[email protected]> wrote:
> This is an issue in PigStorage is present in recent versions of pig.
> Ie
> you
> cannot have complex types (bag, tuple, map) as a value in map type, if
you
> are using PigStorage .
> See - https://issues.apache.org/jira/browse/PIG-1016
>
> -Thejas
>
>
> On 1/5/10 10:28 AM, "Alan Gates" <[email protected]> wrote:
>
> > It should be supported. You may need to explicitly cast it to a
> > tuple
> > so Pig knows to treat it as a tuple. Can you send the scripts that
> > are giving the error?
> >
> > Alan.
> >
> > On Jan 4, 2010, at 9:10 PM, Guy Bayes wrote:
> >
> >> Is this supported?
> >>
> >> Say I have a map
> >>
> >> [f2#(1,6)]
> >>
> >> I cannot figure out how to de-reference the (1,6) tuple, I either
> >> get type
> >> conversion failure and () returned, or a 1066 error message "ERROR
> >> 1066:
> >> Unable to open iterator for alias"
> >>
> >> thanks
> >> Guy
> >
>
>
--
you may be acquainted with the night
but i have seen the darkness in the day
and you must know it is a terrifying sight...