THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Generate eclipse files:
ant clean eclipse-files -Dhadoopversion=23
Pre-compile and generate sources
ant compile gen -Dhadoopversion=23
Import Pig project into Eclipse
- Open Eclipse
- Select File->Import
- Select General->Existing Projects Into Workspace
- Select root directory (point to <top-level-directory>)
- Click Finish
- Project -> Properties -> Java Build Path -> Source -> Add Folder test/perf/pigmix/src/java
- Project -> Properties -> Java Build Path -> Libraries -> Remove javacc-4.2.jar.
- Project -> Properties -> Java Build Path -> Libraries -> Add JAR test/perf/pigmix/lib/sdsuLibJKD12.jar.
- Project -> Properties -> Java Build Path -> Libraries -> Add External JAR hadoop-yarn-server-applicationhistoryservice-*.jar. (I had to find and download this jar myself. It is needed for running tests.)
Run Pig Main
- Create a new Run Configurations
- Pick "org.apache.pig.Main" as the Main class
...
- Create a new Junit Run Configurations, pick any Pig test suite as "Test class"
- In "VM arguments", put "-Xmx1024m -Dhadoop.log.dir=build/test/logs"
- Change "Working directory" into your PIG_HOME
- In Classpath, add one user entries "${USER}/pigtest/conf$PIG_HOME/build/classes" and "$PIG_HOME/pig*.jar"
Troubleshooting
- Build problems: Check if eclipse is using JDK version 1.6, pig needs it (Under Preferences/Java/Compiler).
- If you encounter this error: Missing required library: 'build/ivy/lib/Pig/javacc-4.2.jar' try one of the solutions described in PIG-3399.