pig-user  

Re: contains

Jeff Zhang
Fri, 19 Mar 2010 17:34:09 -0700

This is the data model of pig, you can treat databag as a collection of
tuples, and tuple as a record which contains multiple fields.


On Sat, Mar 20, 2010 at 2:38 AM, hc busy <hc.b...@gmail.com> wrote:

> done. It's kind of odd, that bag always contain tuples...
>
> because if I want to find a string in a bag of strings... I have to iterate
> through the bag, take out string inside each tuple.get(0) and then do the
> search.
>
> contains("key1", {("key1"),("key2"),("key3")});
>
>
> On Thu, Mar 18, 2010 at 7:45 PM, Jeff Zhang <zjf...@gmail.com> wrote:
>
> > I am afraid you have to write your udf for this.
> >
> >
> > On Thu, Mar 18, 2010 at 2:43 AM, hc busy <hc.b...@gmail.com> wrote:
> >
> > > Just a quick q, is there a way to evaluate "contains"?
> > >
> > > contains((1,2), {(2,4),(4,5),(6,7),(1,2)});
> > >
> > >
> > > thnx
> > >
> >
> >
> >
> > --
> > Best Regards
> >
> > Jeff Zhang
> >
>



-- 
Best Regards

Jeff Zhang