You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Saurabh Nanda <sa...@gmail.com> on 2010/01/05 11:19:32 UTC
Help with regexp_extract sytax
Hi, I'm trying the following query but it doesn't seem to be syntactically
correct:
hive> select to_date(ts), regexp_extract(cookies, '(urltrack__goo.*?;)', 1)
from hits
> where dt='2009-04' and lower(cookies) rlike '(.*)urltrack__goo(.*)'
> limit 5;
FAILED: Parse Error: line 1:60 mismatched input '*' expecting Identifier in
expression specification
Can anyone tell me what's wrong with my regept_extract expression?
Thanks,
Saurabh.
--
http://nandz.blogspot.com
http://foodieforlife.blogspot.com
Re: Help with regexp_extract sytax
Posted by Saurabh Nanda <sa...@gmail.com>.
Thanks, works now :-)
Saurabh.
On Wed, Jan 6, 2010 at 8:12 AM, Amr Awadallah <aa...@cloudera.com> wrote:
> ; throwing it off, try:
>
>
> select to_date(ts), regexp_extract(cookies, '(urltrack__goo.*?\;)', 1)
> from hits where dt='2009-04' and lower(cookies) rlike
> '(.*)urltrack__goo(.*)'
> limit 5;
>
> On 1/5/2010 2:19 AM, Saurabh Nanda wrote:
>
>> Hi, I'm trying the following query but it doesn't seem to be syntactically
>> correct:
>>
>>
>> hive> select to_date(ts), regexp_extract(cookies, '(urltrack__goo.*?;)',
>> 1) from hits
>> > where dt='2009-04' and lower(cookies) rlike '(.*)urltrack__goo(.*)'
>> > limit 5;
>> FAILED: Parse Error: line 1:60 mismatched input '*' expecting Identifier
>> in expression specification
>>
>> Can anyone tell me what's wrong with my regept_extract expression?
>>
>> Thanks,
>> Saurabh.
>> --
>> http://nandz.blogspot.com
>> http://foodieforlife.blogspot.com
>>
>
--
http://nandz.blogspot.com
http://foodieforlife.blogspot.com
Re: Help with regexp_extract sytax
Posted by Amr Awadallah <aa...@cloudera.com>.
; throwing it off, try:
select to_date(ts), regexp_extract(cookies, '(urltrack__goo.*?\;)', 1)
from hits where dt='2009-04' and lower(cookies) rlike
'(.*)urltrack__goo(.*)'
limit 5;
On 1/5/2010 2:19 AM, Saurabh Nanda wrote:
> Hi, I'm trying the following query but it doesn't seem to be
> syntactically correct:
>
>
> hive> select to_date(ts), regexp_extract(cookies,
> '(urltrack__goo.*?;)', 1) from hits
> > where dt='2009-04' and lower(cookies) rlike '(.*)urltrack__goo(.*)'
> > limit 5;
> FAILED: Parse Error: line 1:60 mismatched input '*' expecting
> Identifier in expression specification
>
> Can anyone tell me what's wrong with my regept_extract expression?
>
> Thanks,
> Saurabh.
> --
> http://nandz.blogspot.com
> http://foodieforlife.blogspot.com