BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
Shannon23_11
Calcite | Level 5

Hi all, I'm working on an activity in Lesson 3 of the SAS and Hadoop section. I've been trying to execute Pig in Grunt:

 

C1 = load '/user/student/dihdm/data/census_2010.csv' USING
PigStorage() AS (county:chararray, population:int);
C2 = FOREACH C1 GENERATE county, population;
C3 = limit C2 5;

I keep getting this syntax error: 

-bash: syntax error near unexpected token '('

 

Can anyone help me with this?

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
We'll ask the course instructors to take a look. I do have some additional questions. Were you working on a FRESH image or a SAVED image in the Virtual Lab? This activity is in Lesson 3. Did you encounter any other issues in the course prior to this activity?

Thanks,
Cynthia
Shannon23_11
Calcite | Level 5

Hi Cynthia,

I was experiencing problems prior to this activity where server04 did not want to connect. I was using a saved image. I made a new reservation with a fresh image and everything was executing properly in mRemoteNG. Once I signed into Hue to review the external table I created, it was not there, even though mRemoteNG showed that it was created. I refreshed the database tables in Hue and also tried logging out and in again, but that didn't help. I checked the troubleshooting document and restarted Hue from Cloudera Manager, then it seemed to work. Is there a way to prevent these problems from occurring?  It eats away at my lab time and is quite frustrating having to start a new reservation each time with a fresh image.

Cynthia_sas
SAS Super FREQ

Hi:
When you use a saved image, there can be issues connecting. It's a good idea with a saved image to check Cloudera to see whether everything is "green" before you start working. You might want to do the restart first, if you're working from a SAVED image.

Regarding your original question, the instructors said it looked like you typed everything correctly, but wondered whether you had a stray line break or ctrl+l in the string you typed. They recommended as a quick test would be to open a new grunt command line and TYPE in the C1 load line (all in one line without any breaks) and then output C1 using this command: DUMP C1; If that’s successful, then you can type in the C2 and C3 lines.

C1 = load '/user/student/dihdm/data/census_2010.csv' USING PigStorage() AS (county:chararray, population:int);
C2 = FOREACH C1 GENERATE county, population;
C3 = limit C2 5;

In a true production environment, you would NOT have to worry about the servers and services being available because that would be under the control of your systems group. However, with the Virtual Lab, when you work from a SAVED image, the servers may not start back up when Amazon brings the image back into memory, so it's a good idea to check and restart before you resume working (following the troubleshooting document).

Cynthia

Shannon23_11
Calcite | Level 5

Thanks Cynthia. I will try this.

 

This is a knowledge-sharing community for learners in the Academy. Find answers to your questions or post here for a reply.
To ensure your success, use these getting-started resources:

Estimating Your Study Time
Reserving Software Lab Time
Most Commonly Asked Questions
Troubleshooting Your SAS-Hadoop Training Environment

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 821 views
  • 0 likes
  • 2 in conversation