Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fix formatting on "ant thriftif"

...

This page describes the mechanics of how to contribute software to Apache Hive. For ideas about what you might contribute, please see open tickets in Jira.

Table of Contents

Info
titleMavenization is complete

Hive now uses maven as a build tool as opposed to ant.

...

Get the source code on your local drive using SVN. Most development is done on the "trunk":

Code Block

svn checkout http://svn.apache.org/repos/asf/hive/trunk hive-trunk

You also have the option of using one of the Git mirrors of the SVN repository:

Code Block

git clone git://git.apache.org/hive.git

or

Code Block

git clone http://github.com/apache/hive.git

...

When submitting a patch it's highly recommended you execute tests locally which you believe will be impacted in addition to any new tests. The full test suite can be executed by Hive PreCommit Patch Testing. See Hive Developer FAQ to see how to execute a specific set of tests.

Code Block

> cd hive-trunk
> mvn clean install -DskipTests -Phadoop-1
> mvn test -Dtest=SomeTest -Phadoop-1

...

After a while, if you see

Code Block

[INFO] BUILD SUCCESS

all is ok, but if you see

Code Block

[INFO] BUILD FAILURE

Unit tests take a long time (several hours) to run sequentially even on a very fast machine; for information on how to run them in parallel, see Hive PreCommit Patch Testing

...

Check to see what files you have modified with:

Code Block

svn stat

Add any new files with:

Code Block

svn add .../MyNewClass.java
svn add .../TestMyNewClass.java
svn add .../XXXXXX.q
svn add .../XXXXXX.q.out

In order to create a patch, type (from the base directory of hive):

Code Block

svn diff > HIVE-1234.1.patch.txt

...

If you are using Git instead of Subversion, it's important that you generate your patch using the following command:

Code Block

git diff --no-prefix <commit> > HIVE-1234.1.patch.txt

...

To apply a patch either you generated or found from JIRA, you can issue

Code Block

patch -p0 < cool_patch.patch

if you just want to check whether the patch applies you can run patch with --dry-run option

Code Block

patch -p0 --dry-run < cool_patch.patch

...

MVN:

The maven equivalent of {{ant thriftif} is:

Code Block

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

...