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 Plain View
Pig >> mail # user >> Replacing values


Copy link to this message
-
Replacing values
I have some tuples and I would like to be able to transform the first
row using the REGEX_EXTRACT method but leave all the other rows
untouched. Now I can easily do this with known and/or named fields but I
do not know the exact number of values in each tuple so something like
the following will not work:

foo = foreach views generate REGEX_EXTRACT($0, '.*\\b(\\d+)$', 1), $1,
$2, $3

I've tried the following but this duplicates the first value un-extracted:

foo = foreach views generate REGEX_EXTRACT($0, '.*\\b(\\d+)$', 1), *

Is there anyway I can accomplish modifying just the first value in each
tuple with an unknown number of values in each tuple?

Thanks
+
Thejas Nair 2011-08-10, 17:31
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