pig script or normal pig command

0 votes

Hello Abhi,

Hope you haven't understood the requirement. 

Everytime in he pig script or normal pig command while creating relation i need to hardcode the path of the pig location such as hdfs://localhost:8020/user/edureka/SourceFiles/Pig/student_details.txt'( highlighted in red color). Can we create an environment varaible for the path location . If yes then please do let me know.

Dec 18, 2017 in Data Analytics by anonymous
572 views

1 answer to this question.

0 votes

Dear Narayan,

Please accept our sincere apologies for the delay in response. Let's say we have a Pig Script File which consist of the below Pig Script:

A = load '$input' using PigStorage(',') as (f1:int,f2:int);

We can execute the Script by giving the complete path in the command line as shown below:

pig -f script.pig -param input=/input.txt

Now this will execute the Pig Script and will take the Input File from the command Line Parameter.

Please feel free to revert if you have any query.

We will wait for your response.

answered Dec 18, 2017 by Sudhir
• 1,570 points

Related Questions In Data Analytics

0 votes
1 answer

Read command line parameters from an R script

Here's an example to explain : Two files ...READ MORE

answered Apr 17, 2018 in Data Analytics by kappa3010
• 2,090 points
3,670 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,925 views
0 votes
1 answer
0 votes
1 answer

How can I Split code over multiple lines in an R script?

You can do this as follows: setwd(paste("~/a/very/long/path/here ...READ MORE

answered May 22, 2018 in Data Analytics by zombie
• 3,790 points
1,984 views
0 votes
1 answer

Which command is Opposite of %in% ?

We can use the ! operator inorder ...READ MORE

answered May 28, 2018 in Data Analytics by zombie
• 3,790 points
859 views
0 votes
1 answer

Making a ggplot2 plot without any legends,axes or axis labels

The below command will give you the ...READ MORE

answered May 29, 2018 in Data Analytics by Bharani
• 4,660 points
768 views
0 votes
1 answer

How can I suppress warnings globally in an R Script ?

You can use: options(warn=-1) // turning off warnings ...READ MORE

answered May 30, 2018 in Data Analytics by zombie
• 3,790 points
2,239 views
0 votes
1 answer

Finding the nth highest value in a vector or a data-frame column

sort(x,T)[n] Here, 'x' is the data-frame/vector and 'n' ...READ MORE

answered May 31, 2018 in Data Analytics by Bharani
• 4,660 points
8,867 views
0 votes
1 answer

Pig - Grunt shell

Dear Narayan, Hope you are doing great. You don't ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
932 views
+1 vote
1 answer

Executing the pig commands

Dear Narayana, Hope you are doing great. Yes you ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,570 points
582 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP