You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Russell Jurney <ru...@gmail.com> on 2010/09/26 19:50:22 UTC

NOT matches

How do you filter a relation by a field NOT matching a regex?

You would think this would work, but it does not:  B = FILTER A BY field_foo
NOT matches 'test'

Russ

Re: Group By Hour

Posted by Kim Vogt <ki...@simplegeo.com>.
Check out the datetime UDFs in piggybank.  If you
convert<http://hadoop.apache.org/pig/docs/r0.7.0/api/org/apache/pig/piggybank/evaluation/datetime/convert/CustomFormatToISO.html>your
timestamps to ISO format you can use
ISOToHour<http://hadoop.apache.org/pig/docs/r0.7.0/api/org/apache/pig/piggybank/evaluation/datetime/truncate/ISOToHour.html>
.

-Kim

On Mon, Sep 27, 2010 at 11:35 AM, Brian Adams <Br...@chacha.com>wrote:

> I have a timestamp of 2010-09-05 23:52:11,567
>
> And I want to group by hour.
>
> Anyone have a udf that works for that format?
>
> -----Original Message-----
> From: Russell Jurney [mailto:russell.jurney@gmail.com]
> Sent: Sunday, September 26, 2010 1:50 PM
> To: pig-user@hadoop.apache.org
> Subject: NOT matches
>
> How do you filter a relation by a field NOT matching a regex?
>
> You would think this would work, but it does not:  B = FILTER A BY
> field_foo
> NOT matches 'test'
>
> Russ
>

Group By Hour

Posted by Brian Adams <Br...@chacha.com>.
I have a timestamp of 2010-09-05 23:52:11,567

And I want to group by hour. 

Anyone have a udf that works for that format?

-----Original Message-----
From: Russell Jurney [mailto:russell.jurney@gmail.com] 
Sent: Sunday, September 26, 2010 1:50 PM
To: pig-user@hadoop.apache.org
Subject: NOT matches

How do you filter a relation by a field NOT matching a regex?

You would think this would work, but it does not:  B = FILTER A BY field_foo
NOT matches 'test'

Russ

Re: NOT matches

Posted by Russell Jurney <ru...@gmail.com>.
Thanks!  Yes, supporting both ways would be cool.

On Mon, Sep 27, 2010 at 5:19 AM, Thejas M Nair <te...@yahoo-inc.com> wrote:

>
>
>
> On 9/26/10 10:50 AM, "Russell Jurney" <ru...@gmail.com> wrote:
>
> > How do you filter a relation by a field NOT matching a regex?
>
> B = FILTER A BY NOT(field_foo matches 'test');
>
> >
> > You would think this would work, but it does not:  B = FILTER A BY
> field_foo
> > NOT matches 'test'
>
> Yes, I think it would make sense to support this sytnax as well. It is more
> readable. It already supports 'is not null', so this will be consistent.
>
> >
> > Russ
> >
>
>
>

Re: NOT matches

Posted by Thejas M Nair <te...@yahoo-inc.com>.


On 9/26/10 10:50 AM, "Russell Jurney" <ru...@gmail.com> wrote:

> How do you filter a relation by a field NOT matching a regex?

B = FILTER A BY NOT(field_foo matches 'test');

> 
> You would think this would work, but it does not:  B = FILTER A BY field_foo
> NOT matches 'test'

Yes, I think it would make sense to support this sytnax as well. It is more
readable. It already supports 'is not null', so this will be consistent.

> 
> Russ
>