hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hc busy <hc.b...@gmail.com>
Subject native types as value of map type? Re: Complex data types as value in a map function
Date Wed, 24 Feb 2010 20:15:16 GMT
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 <fatal.error@gmail.com> 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 <tejas@yahoo-inc.com> 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" <gates@yahoo-inc.com> 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...
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message