Hi Prakash,
You can extract query string from url using 'parse_url' udf.
hive> describe function parse_url;
OK
parse_url(url, partToExtract[, key]) - extracts a part from a URL
Time taken: 0.024 seconds
hive>
hive> select parse_url('
http://www.example.com/searches/tagged_with?company=2-Opico&page=8&product=36154-7653-BACKUP-PLATE-F-STORAGE-STAND&tag=demco',
'QUERY', 'tag') from r;
.
.
Ended Job = job_200911251712_2046
OK
demco
Time taken: 19.405 seconds
hive>
Regards,
Youngwoo
2010/3/9 prakash sejwani <[email protected]>
> Hi All,
> i have a query below
> SELECT regexp_extract(resource,'/\&tag=([^\&]+)/') FROM a_log;
>
> it gives black result
>
> the sample resource string is like this
> "/searches/tagged_with?company=2-Opico&page=8&product=36154-7653-BACKUP-PLATE-F-STORAGE-STAND&tag=demco"
> i want to extract demco out of it
>
> please help me with this
>
>
> thanks'
> prakash
> Econify Infotech
> Mumbai
>
>