Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: move questions about testing from Building to Testing, misc. edits

...

The script should be a set of svn mv commands along with any perl commands required for find/replace. E.g.For example:

No Format
$ svn mv MyCLass.java MyClass.java
$ perl -i -pe 's<at:var at:name="MyCLass" />MyClass@g' MyClass.java

Building

...

The qfile tests in itests require the packaging phase. The maven test phase is after compile and before packaging. We could change the qfile tests to run during the integration-test phase using the "failsafe" plugin but the "failsafe" plugin is different than surefire and IMO is hard to use. If you'd like to give that a try, by all means, go ahead.

How do I rerun precommit tests over the same patch?

Upload the exact same patch again to the JIRA.

Maven settings

You might have to set the following maven Maven options on certain systems to get build working. Check out the suggested value for MAVEN_OPTS under the testing section (How do I run all of the unit tests?).

How to build all source?

...

In mvn commands, use -Phadoop-1 or -Phadoop-2 to specify the Hadoop version. Several examples are shown in these build instructions.

How do I import into

...

Eclipse?

Build and generate eclipse Eclipse files (the conservative method):

Code Block
$ mkdir workspace
$ cd workspace
$ git clone https://github.com/apache/hive.git
$ cd hive
$ mvn clean install -DskipTests -Phadoop-2
$ mvn eclipse:clean
$ mvn eclipse:eclipse -DdownloadSources -DdownloadJavadocs -Phadoop-2
$ cd itests
$ mvn clean install -DskipTests -Phadoop-2
$ mvn eclipse:clean
$ mvn eclipse:eclipse -DdownloadSources -DdownloadJavadocs -Phadoop-2

In eclipse Eclipse define M2_REPO in Preferences -> Java -> Build Path -> Classpath Variables to either:

Mac Example:

Code Block
/Users/$USER/.m2/repository

Linux Example:

Code Block
/home/$USER/.m2/repository

Windows Example:

Code Block
C:/users/$USER/.m2/repository

Then import the workspaces. If you get an error about "restricted use of Signal" for beeline Beeline and cli CLI, follow the following these instructions.

Note that if you use the hive Hive git base dir directory as eclipse the Eclipse workspace, then it does not pick the right project names (eg 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 Eclipse workspace and hive is the git base directory.

...

It will then be located in the packaging/target/ directory.

How to generate protobuf code?

...

Code Block
cd ql
mvn clean install -DskipTests -Phadoop-1,protobuf

How to generate

...

Thrift code?

MVN:

Code Block
mvn clean install -Phadoop-1,thriftif -DskipTests -Dthrift.home=/usr/local

...

Code Block
cd odbc
mvn compile -Phadoop-1,odbc -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

...

No Format
mvn test -Dtest=ClassName#methodName -Phadoop-1

Why isn't the itests pom connected to the root pom?

The qfile tests in itests require the packaging phase. The Maven test phase is after compile and before packaging. We could change the qfile tests to run during the integration-test phase using the "failsafe" plugin but the "failsafe" plugin is different than surefire and IMO is hard to use. If you'd like to give that a try, by all means, go ahead.

How do I debug into a single test in Eclipse?

...

Code Block
mvn clean install -DskipTests -Phadoop-1
cd itests 
mvn clean install -DskipTests -Phadoop-1

How do I update the output of a CliDriver testcase?

Code Block
ant test -Dtestcase=TestCliDriver -Dqfile=alter1.q -Doverwrite=true

...

To run all of the clientpositive tests that match a regex, e.g. for example the partition_wise_fileformat tests

...

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. For example, run all the partition_wise_fileformat tests

Code Block
ant -Dmodule=ql -Dtestcase=TestCliDriver -Dqfile_regex=partition_wise_fileformat.* test

How do I rerun precommit tests over the same patch?

Upload the exact same patch again to the JIRA.