<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to extact two fields( more than one) in pig nested foreach in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117280#M16981</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;According to my requirement i need script like following&lt;/P&gt;&lt;PRE&gt;A = load '/bsuresh/sample' USING PigStorage(',') as (id,name,sal,deptid);
 B = GROUP A by deptid;
 C = foreach B {
         D = A.name,A.sal;--two fields
	 E = DISTINCT D;
         generate group,COUNT(E);
};
&lt;/PRE&gt;&lt;P&gt;In relation 'D', i am extracting two fields.Where exactly i am facing error.&lt;/P&gt;&lt;P&gt;If i chnaged the script like,which is working fine.&lt;/P&gt;&lt;PRE&gt;C = foreach B {
         D = A.name; --one filed
 	 E = DISTINCT D;
        generate group,COUNT(E);
};&lt;/PRE&gt;&lt;P&gt;But i need count based on distinct of two columns .Can any one help me??&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2016 18:31:44 GMT</pubDate>
    <dc:creator>bsuresh</dc:creator>
    <dc:date>2016-01-29T18:31:44Z</dc:date>
    <item>
      <title>How to extact two fields( more than one) in pig nested foreach</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117280#M16981</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;According to my requirement i need script like following&lt;/P&gt;&lt;PRE&gt;A = load '/bsuresh/sample' USING PigStorage(',') as (id,name,sal,deptid);
 B = GROUP A by deptid;
 C = foreach B {
         D = A.name,A.sal;--two fields
	 E = DISTINCT D;
         generate group,COUNT(E);
};
&lt;/PRE&gt;&lt;P&gt;In relation 'D', i am extracting two fields.Where exactly i am facing error.&lt;/P&gt;&lt;P&gt;If i chnaged the script like,which is working fine.&lt;/P&gt;&lt;PRE&gt;C = foreach B {
         D = A.name; --one filed
 	 E = DISTINCT D;
        generate group,COUNT(E);
};&lt;/PRE&gt;&lt;P&gt;But i need count based on distinct of two columns .Can any one help me??&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 18:31:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117280#M16981</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2016-01-29T18:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extact two fields( more than one) in pig nested foreach</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117281#M16982</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt;have you looked at &lt;A href="https://pig.apache.org/docs/r0.15.0/api/org/apache/pig/builtin/CONCAT.html"&gt;Concat&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 20:33:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117281#M16982</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-01-29T20:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to extact two fields( more than one) in pig nested foreach</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117282#M16983</link>
      <description>&lt;P&gt;Yeah ...@&lt;A href="https://community.hortonworks.com/users/393/aervits.html"&gt;Artem Ervits&lt;/A&gt; i got your point.simple but logical.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 23:35:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117282#M16983</guid>
      <dc:creator>bsuresh</dc:creator>
      <dc:date>2016-01-29T23:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extact two fields( more than one) in pig nested foreach</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117283#M16984</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1146/bsuresh.html" nodeid="1146"&gt;@Suresh Bonam&lt;/A&gt; let me know if that works for you and close the thread :).&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 23:39:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-extact-two-fields-more-than-one-in-pig-nested-foreach/m-p/117283#M16984</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-01-29T23:39:31Z</dc:date>
    </item>
  </channel>
</rss>

