Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 01-29-2016 10:31 AM
Hi All,
According to my requirement i need script like following
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);
};
In relation 'D', i am extracting two fields.Where exactly i am facing error.
If i chnaged the script like,which is working fine.
C = foreach B {
D = A.name; --one filed
E = DISTINCT D;
generate group,COUNT(E);
};But i need count based on distinct of two columns .Can any one help me??
Created 01-29-2016 12:33 PM
@Suresh Bonamhave you looked at Concat?
Created 01-29-2016 12:33 PM
@Suresh Bonamhave you looked at Concat?
Created 01-29-2016 03:35 PM
Yeah ...@Artem Ervits i got your point.simple but logical.
Created 01-29-2016 03:39 PM
@Suresh Bonam let me know if that works for you and close the thread :).