Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Need to parse the data from [ ]


Copy link to this message
-
Re: Need to parse the data from [ ]
I suppose you need to use the RegExp groups for that, something like
([(.*),(.*)...]), and I think you need to escape []
Basically this is not a Pig problem, I would test the RegExp in Java first.

Ruslan
On Thu, Sep 26, 2013 at 4:36 PM, Muni mahesh <[EMAIL PROTECTED]>wrote:

> *Input Data :*
>
> ([37.77916,-122.42005,2496043,"A Poor Recipe For Civic Cohesion","Western
> Addiction",0.48169413,1854.5113390616634],)
> ([41.88415,-87.63241,8522644,"Take Time","Chaka Khan_
> Rufus",0.25427926,1854.5113390616634],)
>
> *Expected Output :*
>
> (37.77916,-122.42005,2496043,"A Poor Recipe For Civic Cohesion","Western
> Addiction",0.48169413,1854.5113390616634)
>
> (41.88415,-87.63241,8522644,"Take Time","Chaka Khan_
> Rufus",0.25427926,1854.5113390616634)
>
> *I tried like :*
>
> extract =  foreach Displayed generate
> REGEX_EXTRACT_ALL([.*,.*,.*,.*,.*,.*]);
>
> using flatten, regex
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB