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 >> FLATTEN is not working


Copy link to this message
-
FLATTEN is not working
I have a file with below data

xxxxx   11,22,33        44,55,66        77,88,99

I wrote below PIG  script

X= LOAD '/user/lnindrakrishna/tmp/ExpTag.txt' AS (id :chararray,qc
:chararray ,qt :chararray ,qe :chararray  );

Y = Foreach X generate id, STRSPLIT(qc,',') AS split_qc  , STRSPLIT(qt,',')
AS  split_qt, STRSPLIT(qe,',') AS split_qe;;

Z = foreach Y generate id, FLATTEN(TOBAG(split_qc));

I expected output as follows:

xxxxx 11
xxxxx 22
xxxxx 33

But the above script is producing output as follows

(xxxxx,11,22,33)

FLATTEN is not actually flattening the bag of tuple. Any inputs here?

- Thanks
+
Harsha 2013-03-07, 01:29
+
Mix Nin 2013-03-07, 01:46
+
Harsha 2013-03-07, 02:00
+
Mix Nin 2013-03-07, 15:03
+
Mix Nin 2013-03-07, 20:43
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