[Solved-3 Solutions] How to include external jar file using PIG ?



Problem :

How to include external jar file using PIG ?

Solution 1:

There are two ways to add external jars to Pig environment.

1.Use "-Dpig.additional.jars" to start Pig

pig -Dpig.additional.jars=/local/path/to/your.jar

2. Use "register" command in Pig scripts or grunt

register /local/path/to/your.jar;

We can use any one according to your requirement.

Solution 2:

We can also specify multiple jar paths as

pig -Dpig.additional.jars="/local/path/1/*:/local/path/2/*"

Solution 3:

Use the below path to include external jar file

register /local/path/to/myJar.jar

Related Searches to How to include external jar file using PIG ?