You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Jonathan Coveney <jc...@gmail.com> on 2011/01/11 18:24:13 UTC

Interacting with Maps[]?

I'm just curious how people usually interact with Maps? Do you write UDFs
that do interesting things with the maps and simply take advantage of the
fact that pig can deal with datatypes, or do you use java's functions on a
pig level? For things like constructing maps, doing a filter on whether a
given key or value is in a map, etc, just curious what people do. I looked
around and didn't see too much on it, if there's some documentation on use
I'd love to see it!

Re: Interacting with Maps[]?

Posted by Jonathan Coveney <jc...@gmail.com>.
Ah, cool. Just wanted to make sure I wasn't crazy before going UDF hogwild
:)

2011/1/11 Dmitriy Ryaboy <dv...@gmail.com>

> At Twitter, we tend to write UDFs because types are kind of broken for
> maps.
> Though a lot of stuff can be done in pig -- like if key->null and key not
> existing are the same thing for your, you can filter by mymap#'key' is not
> null.
>
> iirc some of the type brokenness is fixed in trunk.
>
> D
>
> On Tue, Jan 11, 2011 at 9:24 AM, Jonathan Coveney <jcoveney@gmail.com
> >wrote:
>
> > I'm just curious how people usually interact with Maps? Do you write UDFs
> > that do interesting things with the maps and simply take advantage of the
> > fact that pig can deal with datatypes, or do you use java's functions on
> a
> > pig level? For things like constructing maps, doing a filter on whether a
> > given key or value is in a map, etc, just curious what people do. I
> looked
> > around and didn't see too much on it, if there's some documentation on
> use
> > I'd love to see it!
> >
>

Re: Interacting with Maps[]?

Posted by Dmitriy Ryaboy <dv...@gmail.com>.
At Twitter, we tend to write UDFs because types are kind of broken for maps.
Though a lot of stuff can be done in pig -- like if key->null and key not
existing are the same thing for your, you can filter by mymap#'key' is not
null.

iirc some of the type brokenness is fixed in trunk.

D

On Tue, Jan 11, 2011 at 9:24 AM, Jonathan Coveney <jc...@gmail.com>wrote:

> I'm just curious how people usually interact with Maps? Do you write UDFs
> that do interesting things with the maps and simply take advantage of the
> fact that pig can deal with datatypes, or do you use java's functions on a
> pig level? For things like constructing maps, doing a filter on whether a
> given key or value is in a map, etc, just curious what people do. I looked
> around and didn't see too much on it, if there's some documentation on use
> I'd love to see it!
>