The following ant package should be installed with ant in order for the following commands to work:
- ant-nodeps.x86_64
After checking out the source code run the following from the top-level directory:
$ ant eclipse-files -Dhadoop.version="<your-hadoop-version>"
$ ant package -Dhadoop.version="<your-hadoop-version>"
- $ cd metastore
$ ant model-jar -Dhadoop.version="<your-hadoop-version>"
- $ cd ../ql
$ ant gen-test -Dhadoop.version="<your-hadoop-version>"
Remember to use the complete release number for the hadoop.version values above (i.e., 0.19.0, 0.18.2, ...). For example: $ ant eclipse-files -Dhadoop.version=0.17.0
After running these commands, you should see the following new files/directories in the top-level-directory.
- .classpath
- .settings
- .project
- Several .launch files
Now open up eclipse and do the following:
File->Import->General->Existing Projects Into Workspace->Select root directory (point to <top-level-directory>)
For hadoop-0.17 you can use the java builder and run automatic builds. Do the following to disable the ant builder:
Project->Properties->Builders - uncheck Hive_Ant_Builder -> OK
Make sure that Eclipse Java Compiler is in 1.6 compatibility mode:
Project->Properties->Java Compiler->(Check)Enable project specific settings->(Change to 1.6)Compiler compliance level
This should import the project and the launch configurations. You can look for launch configurations by checking:
Run->Run Configurations->JUnit.
There should be several configurations including TestCliDriver, TestJdbc, and TestHive.
Then, you should be able to run all the unit tests by Run->Run.