...
In master, only Hadoop 2.x is supported, thus there is no need to specify a Maven profile for most build operations.
In master, MVN:
Code Block |
---|
mvn clean install -DskipTests
cd itests
mvn clean install -DskipTests |
...
Note that if you use the Hive git base directory as the Eclipse workspace, then it does not pick the right project names (for example, 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?
MVN:
Code Block |
---|
|
mvn clean package -DskipTests -Pdist
|
...
How to generate protobuf code?
MVN:
Code Block |
---|
cd ql
mvn clean install -DskipTests -Pprotobuf
|
How to generate Thrift code?
...
Code Block |
---|
mvn clean install -Pthriftif -DskipTests -Dthrift.home=/usr/local |
...
Note: Available in Hive 1.1.0 onward (see HIVE-8327).
How to compile ODBC?
MVN:
Code Block |
---|
cd odbc
mvn compile -Podbc -Dthrift.home=/usr/local -Dboost.home=/usr/local
|
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
|
...
Code Block |
---|
|
mvn clean install -DskipTests
cd itests
mvn clean install -DskipTests
|
Info |
---|
title | Legacy information for the Ant build |
---|
|
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"
|
Then, for a clean build, run
How do I run all of the unit tests except for a certain few tests?
Similar to running all tests, but define test.excludes.additional to specify a test/pattern to exclude from the test run. For example the following will run all tests except for the CliDriver tests:
Code Block |
---|
|
antcd cleanitests package
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. |
How do I run all of the unit tests except for a certain few tests?
Similar to running all tests, but define test.excludes.additional to specify a test/pattern to exclude from the test run. For example the following will run all tests except for the CliDriver tests:
-Dtest.excludes.additional='**/Test*CliDriver.java' |
How do I run the clientpositive/clientnegative unit tests?
All of the below require that you have previously run ant package
.
To run clientpositive tests
Code Block |
---|
cd itests/qtest
mvn test -Dtest=TestCliDriver |
To run a single clientnegative test alter1.q
Code Block |
---|
cd itests/qtest |
Code Block |
---|
|
cd itests
mvn test -Dtest.excludes.additional='**/Test*CliDriver.java' |
How do I run the clientpositive/clientnegative unit tests?
All of the below require that you have previously run ant package
.
To run clientpositive tests
Code Block |
---|
ant -Dtestcase=TestCliDriver test |
=TestNegativeCliDriver -Dqfile=alter1.q |
To run all of the clientpositive tests that match a regex, for example the partition_wise_fileformat testsMVN:
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-Dqfile_regex=partition_wise_fileformat.*
# Alternatively, you can specify comma separated list with "-Dqfile" argument
mvn test -Dtest=TestNegativeCliDriverTestMiniLlapLocalCliDriver -Dqfile=alter1.q |
To run all of the clientpositive tests that match a regex, for example 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.*
# Alternatively, you can specify comma separated list with "-Dqfile" argument
mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile='vectorization_0.q,vectorization_17.q,vectorization_8.q' |
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. For example, run all the partition_wise_fileformat tests
'vectorization_0.q,vectorization_17.q,vectorization_8.q' |
To run a single contrib test alter1.q and overwrite the result file
Code Block |
---|
|
cd itests/qtest
mvn test -Dtest=TestContribCliDriver -Dqfile=alter1.q -Dtest.output.overwrite=true |
Code Block |
---|
ant -Dmodule=ql -Dtestcase=TestCliDriver -Dqfile_regex=partition_wise_fileformat.* test
|
How do I modify the init script when testing?
...
How do I update the output of a CliDriver testcase?
Code Block |
---|
|
ant test -Dtestcase=TestCliDriver -Dqfile=alter1.q -Doverwrite=true
|
...
a CliDriver testcase?
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
Code Block |
---|
|
ant test -Dmodule=ql -Dtestcase=TestCliDriver -Dqfile=alter1.q -Doverwrite=true
|
How do I update the results of many test cases?
...