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 >> simple pig logic


Copy link to this message
-
simple pig logic
Hi,
 I have two datasets..
main_data.txt
{"id":"foo", "some_field:12354, "score":0}
{"id":"foobar", "some_field:12354, "score":0}
score_data.txt
{"id":"foo", "score":1}
{"id":"foobar","score":20}
....
So in main_data.. score is initialized to 0..
Also.. main_data and score_data have some ids in common..

For the ids which are common:
I want to replace "score" in main_data with score in score_data

And if the element is absent.. then I want to let the score to 0 itself..
+
Pradeep Gollakota 2013-10-31, 19:08
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