- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
grouping a relation in pig
- Labels:
-
Apache Pig
Created on ‎06-01-2017 12:16 PM - edited ‎08-17-2019 11:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone, I'm trying to perform a grouping for a relation with the scheme below:
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
Unfortunatelly I'm getting this error:
Please guys give me a light about this error i will appreciate so much.
Thanks so much.
AU
Created ‎06-02-2017 04:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Created ‎06-02-2017 04:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Created ‎06-05-2017 12:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks , tried and working. I have just to be more careful on my typing. I appriciate.
Created ‎06-07-2017 08:06 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Excellent. Truthfully, the case sensitivity is a bit weird in Pig -- kind of like the rules of the English language. Hehe!
