Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Setting execution type as tez inside pig script.


Is there any way setting up execution mode as tez inside pig script.

i have tried various variation of set exectype=tez to use inside pig script but its not working.

I know it can be done through command line as pig -x tez -f filename

But in the HDPCD certification preparation task, question is asked like

Question: Write a pig script that satsifies following criteria

1. run the pig query using tez as execution engine

2. load data from hive table to pig using hcatalog

So i am confused whether we have to set something inside pig script that will make script run through TEZ.


Rising Star

@pankaj chaturvedi You cannot make Pig run with the Tez execution engine via a Pig script. The "Pig Script" row in the first table of Running Pig with the Tez Execution Engine is wrong.

Instead, look at the same doc link and configure Pig to run with Tez by following the information in the "Command Line" or "Pig Properties" row of the table.

I will file a doc bug to have this fixed.

Let me know if this post does not solve your problem.

View solution in original post


Rising Star

Also, you can use Java, as @daijy notes. So in summary you should be able to make Pig run on Tez by one of the methods in the first 3 rows of table 1 in Running Pig with the Tez Execution Engine (command line, the file, or Java).


Thanks for the clarification, if possible let us know once documentation is corrected.


This is a mistake in document. You cannot "set exectype=tez;" in a pig script. You will need to set it in, pig command line or JVM option.