Hive Developer FAQ
- Hive Developer FAQ
- Where is the log output of a test?
- How do I run a single test?
- How do I debug into a single test in Eclipse?
- A test fails with a NullPointerException in MiniDFSCluster
- How do I run all of the unit tests?
- How do update the output of a CliDriver testcase?
- How do I run the clientpositive/clientnegative unit tests?
How do I add a new MiniMR test?
How do I move some files?
Post a patch for testing purposes which simply does add and deletes. SVN will not understand these patches are actually moves, therefore you should actually upload the following, in order so the last upload is the patch for testing purposes:
- A patch which has only the non-move changes for commit e.g. HIVE-XXX-for-commit.patch
- A script of of commands required to make the moves HIVE-XXX-moves.sh
- A patch for testing purposes HIVE-XXX.patch
The script should be a set of
svn mv commands along with any
perl commands required for find/replace. E.g.:
How do I rerun precommit tests over the same patch?
Upload the exact same patch again to the JIRA.
You might have to set the following maven options on certain systems to get build working. Check out the suggested value for MAVEN_OPTS under the testing section.
How to build all source?
How do I import into eclipse?
Build and generate eclipse files (the conservative method):
In eclipse define M2_REPO in Preferences -> Java -> Build Path -> Classpath Variables to either:
Then import the workspaces. If you an error about "restricted use of Signal" for beeline and cli follow the following instructions.
Note that if you use the hive git base dir as eclipse workspace, then it does not pick the right project names (eg picks 'ant' instead of 'hive-ant'). Therefore it's recommended to have the workspace directory one up from the git directory. For example workspaces/hive-workspace/hive where hive-workspace is the eclipse workspace and hive is the git base directory.
How to generate tarball?
It will then be located in packaging/target/
How to generate protobuf code?
How to generate thrift code?
How to compile ODBC?
How do I publish hive artifacts to my local maven repository?
Where is the log output of a test?
Logs are put in a couple locations:
From the root of the source tree: find . -name hive.log
/tmp/$USER/ (Linux) or $TMPDIR/$USER/ (MacOS)
How do I run a single test?
Single test class:
Single test method:
How do I debug into a single test in Eclipse?
You can debug into a single JUnit test in Eclipse by first making sure you've built the Eclipse files and imported the project into Eclipse as described here. Then set one or more breakpoints, highlight the method name of the JUnit test method you want to debug into, and do
A test fails with a NullPointerException in MiniDFSCluster
If any test fails with the error below it means you have an inappropriate umask setting. It should be set to 0022.
How do I run all of the unit tests?
Make sure that your JAVA_HOME is appropriately set (some tests need this), and set ANT_OPTS to increase the size allocated to the Permanent Generation as per the following:
Then, for a clean build, run
Note that running
ant test will not work;
ant package does some setup work that is required for the testcases to run successfully.
MVN: Note that you need to have previously built and installed the jars:
How do update the output of a CliDriver testcase?
As of Hive 0.11.0+ you can cut this time in half by specifying that only the ql module needs to rebuild
How do I run the clientpositive/clientnegative unit tests?
All of the below require that you have previously run
To run clientpositive tests
To run a single clientnegative test alter1.q
To run all of the clientpositive tests that match a regex, e.g. the partition_wise_fileformat tests
To run a single contrib test alter1.q and overwrite the result file
To run a single test groupby1.q and output detailed information during execution
As of Hive 0.11.0+ you can cut down the total build time by specifying that only the ql module needs to rebuild. e.g. run all the partition_wise_fileformat tests