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]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

grouping a relation in pig

avatar
Expert Contributor

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

avatar

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!

View solution in original post

3 REPLIES 3

avatar

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!

avatar
Expert Contributor

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

avatar

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