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.

Like Example.jar is there any sample pig scripts available with HDP?

Solved Go to solution

Like Example.jar is there any sample pig scripts available with HDP?

Contributor

Like Example.jar is there any sample pig scripts available with HDP?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Like Example.jar is there any sample pig scripts available with HDP?

Super Collaborator

@Yukti Agrawal , the answer is no. But if you have HUE installed in your cluster, you should see some scripts. Check under this folder /usr/lib/hue/apps/oozie/examples.

Or do simply run locate command to search it.

I would recommend to create a simple script if you just want to test pig. Store a sample csv in HDFS and load that file in Pig:

A = LOAD '/the/path/in/HDFS/sample.csv' USING PigStorage(',') AS (driverId:int, truckId:int, driverName:chararray);

some_columns = FOREACH A GENERATE driverId,driverName;

STORE some_columns into 'output/some_columns' using PigStorage(',');

View solution in original post

3 REPLIES 3
Highlighted

Re: Like Example.jar is there any sample pig scripts available with HDP?

Super Collaborator

@Yukti Agrawal , the answer is no. But if you have HUE installed in your cluster, you should see some scripts. Check under this folder /usr/lib/hue/apps/oozie/examples.

Or do simply run locate command to search it.

I would recommend to create a simple script if you just want to test pig. Store a sample csv in HDFS and load that file in Pig:

A = LOAD '/the/path/in/HDFS/sample.csv' USING PigStorage(',') AS (driverId:int, truckId:int, driverName:chararray);

some_columns = FOREACH A GENERATE driverId,driverName;

STORE some_columns into 'output/some_columns' using PigStorage(',');

View solution in original post

Highlighted

Re: Like Example.jar is there any sample pig scripts available with HDP?

Contributor

Unfortunately we dont have HUE in our cluster. Also locate command is not working in my client's env. I will try this script, hoping it will help.

Highlighted

Re: Like Example.jar is there any sample pig scripts available with HDP?

Super Guru

HWX has pig tuturial with come with data and script. I recommend you try this

http://hortonworks.com/hadoop-tutorial/how-to-process-data-with-apache-pig/

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