Sid
Sid

Reputation: 217

Pig parameter substitution

I have couple of questions around parameter substitution in Pig.

I am on Pig 0.10

  1. Can i access unix environemnt variables in grunt shell ? In Hive we can do this via ${env:variable}

  2. I have bunch of Pig scripts that are automated and running in batch mode. I have used bunch of parameters inside it and I substitute them from command line (either -param or -param_file). When i need to enhance (or debug) the pig script in grunt mode, i am left with manually replacing the parameters with the value. Is there a better way of handling this situations.

Thanks for the help !

Upvotes: 0

Views: 1952

Answers (1)

zsxwing
zsxwing

Reputation: 20826

For the first question, Pig does not support to use the environment. Is there any special requirement? You should be able to pass the environment by the Pig command line parameters.

For the second question, now Pig does not support to use parameters in Grunt. You can check the issue and discussion in PIG-2122. Aniket Mokashi suggests to use the following way:

  • Store your script line in a file (with $params included).
  • Start grunt interactively
  • type run -param a=b -param c=d myscript.pig

Upvotes: 3

Related Questions