Execute Pig from within Java Application Execute Pig from within Java Application hadoop hadoop

Execute Pig from within Java Application


It seems there is Java API for Pig.

According to this API, there is a PigRunner class.

With that, you could easily add it to your Spring application, by creating a dedicated Spring bean.


From what I've seen document wise and example wise is to you the PigServer class. They have examples of using it here: http://pig.apache.org/docs/r0.8.1/setup.html#Sample+Code