Hive Developer FAQ
Info |
---|
title | Mavenization is pending |
---|
|
Until HIVE-5610 is closed the maven commands below will not work. Afterwards the ant commands should be removed. |
Testing
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:
Code Block |
---|
export ANT_OPTS="-XX:MaxPermSize=512m |
...
"
export MAVEN_OPTS="-Xmx2g -XX:MaxPermSize=256M"
|
Then, for a clean build, run
Code Block |
---|
ant clean package test
|
MVN:
Code Block |
---|
mvn test
cd itests
mvn test
|
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:
Code Block |
---|
mvn clean install -DskipTests
cd itests
mvn clean install -DskipTests
|
How do update the output of a CliDriver testcase?
...
ant test -Dtestcase=TestCliDriver -Dqfile=alter1.q -Doverwrite=true
|
MVN:
Code Block |
---|
cd itests/qtest
mvn test -Dtest=TestCliDriver -Dqfile=alter1.q -Dtest.output.overwrite=true
|
As of Hive 0.11.0+ you can cut this time in half by specifying that only the ql module needs to rebuild
...
ant test -Dmodule=ql -Dtestcase=TestCliDriver -Dqfile=alter1.q -Doverwrite=true
|
How do I run the clientpositive/clientnegative unit tests?
...
To run clientpositive tests
Code Block |
---|
ant -Dtestcase=TestCliDriver test
|
MVN:
Code Block |
---|
cd itests/qtest
mvn test -Dtest=TestCliDriver
|
To run a single clientnegative test alter1.q
Code Block |
---|
ant -Dtestcase=TestNegativeCliDriver -Dqfile=alter1.q test
|
MVN:
Code Block |
---|
cd itests/qtest
mvn test -Dtest=TestNegativeCliDriver -Dqfile=alter1.q
|
To run all of the clientpositive tests that match a regex, e.g. the partition_wise_fileformat tests
Code Block |
---|
ant -Dtestcase=TestCliDriver -Dqfile_regex=partition_wise_fileformat.* test
|
MVN:
Code Block |
---|
cd itests/qtest
mvn test -Dtest=TestCliDriver -Dqfile_regex=partition_wise_fileformat.*
|
To run a single contrib test alter1.q and overwrite the result file
Code Block |
---|
ant -Dtestcase=TestContribCliDriver -Dqfile=alter1.q -Doverwrite=true test
|
MVN:
Code Block |
---|
cd itests/qtest
mvn test -Dtest=TestContribCliDriver -Dqfile=alter1.q -Dtest.output.overwrite=true
|
To run a single test groupby1.q and output detailed information during execution
Code Block |
---|
ant -Dtestcase=TestCliDriver -Dqfile=groupby1.q -Dtest.silent=false test
|
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
Code Block |
---|
ant -Dmodule=ql -Dtestcase=TestCliDriver -Dqfile_regex=partition_wise_fileformat.* test
|
How do I publish hive artifacts to my local maven repository?
Code Block |
---|
ant package
ant -Dmvn.publish.repo=local maven-build
ant -Dmvn.publish.repo=local maven-publish
|
MVN:
Code Block |
---|
mvn clean install -DskipTests
cd itests
mvn clean install -DskipTests
|