Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

grouping a relation in pig

Solved Go to solution

grouping a relation in pig

Rising Star

Hi everyone, I'm trying to perform a grouping for a relation with the scheme below:

15913-pigscheme.png

I have created a the group all for whole relation as:

total_station_trips_all = GROUP october ALL;

Finally I'm trying to get the counting for the column s_station from the scheme october like

15914-pigscheme.png

Unfortunatelly I'm getting this error:

15915-pigscheme.png

Please guys give me a light about this error i will appreciate so much.

Thanks so much.

AU

1 ACCEPTED SOLUTION

Accepted Solutions

Re: grouping a relation in pig

You're not going to like it, but it is as simply as upper-casing "count" to be "COUNT". ;-)

This brings up the larger issue around case-sensitivity in Pig. Generally, speaking case only really matters on alias names and things that end up being Java class names. Functions fall into that bucket, so just upper-case it and it'll work.

Additionally, you could simplify the code a bit to just do COUNT(october) instead of COUNT(october.s_station).

Good luck and happy Hadooping!

3 REPLIES 3

Re: grouping a relation in pig

You're not going to like it, but it is as simply as upper-casing "count" to be "COUNT". ;-)

This brings up the larger issue around case-sensitivity in Pig. Generally, speaking case only really matters on alias names and things that end up being Java class names. Functions fall into that bucket, so just upper-case it and it'll work.

Additionally, you could simplify the code a bit to just do COUNT(october) instead of COUNT(october.s_station).

Good luck and happy Hadooping!

Re: grouping a relation in pig

Rising Star

thanks , tried and working. I have just to be more careful on my typing. I appriciate.

Re: grouping a relation in pig

Excellent. Truthfully, the case sensitivity is a bit weird in Pig -- kind of like the rules of the English language. Hehe!

Don't have an account?
Coming from Hortonworks? Activate your account here