<commit_before>---
title: Contributing - Apache DataFu Pig
section_name: Apache DataFu Pig
---

# Contributing

We welcome contributions to the Apache DataFu Pig library!  If you are interested please follow the guide below.

## Get the Code

To clone the repository run the following command:

    git clone git://git.apache.org/incubator-datafu.git

## Eclipse

The following command generates the necessary files to load the project in Eclipse:

    ant eclipse

Note that you may run out of heap when executing tests in Eclipse.  To fix this adjust your heap settings for the TestNG plugin.  Go to Eclipse->Preferences.  Select TestNG->Run/Debug.  Add "-Xmx1G" to the JVM args.

## Build the JAR

    ant jar
    
## Running Tests

All the tests can be run from within eclipse.  However they can also be run from the command line.  To run all the tests:

    ant test

To run specific tests from the command line, you have a few options.  One option is to run all tests within a given class.  To do this, run the same command but override `testclasses.pattern`, which defaults to `**/*.class`.  For example, to run all tests defined in `QuantileTests`:

    ant test -Dtestclasses.pattern=**/QuantileTests.class

The other option is to run a specific test within a class:

    ant test -Dtest.methods=datafu.test.pig.stats.QuantileTests.quantileTest

You may also provide a command separated list of tests:

    ant test -Dtest.methods=datafu.test.pig.stats.QuantileTests.quantileTest,datafu.test.pig.stats.QuantileTests.quantile2Test

## Compute code coverage

We use [Cobertura](http://cobertura.github.io/cobertura/) to compute code coverage, which can be run with:

    ant coverage
<commit_msg>Update website with updated gradle documentation<commit_after>---
title: Contributing - Apache DataFu Pig
section_name: Apache DataFu Pig
---

# Contributing

We welcome contributions to the Apache DataFu Pig library!  If you are interested please follow the guide below.

## Get the Code

To clone the repository run the following command:

    git clone git://git.apache.org/incubator-datafu.git

## Eclipse

The following command generates the necessary files to load the project in Eclipse:

    ./gradlew eclipse

To clean up the eclipse files:

    ./gradlew cleanEclipse

Note that you may run out of heap when executing tests in Eclipse.  To fix this adjust your heap settings for the TestNG plugin.  Go to Eclipse->Preferences.  Select TestNG->Run/Debug.  Add "-Xmx1G" to the JVM args.

## Build the JAR

The Apache DataFu Pig library can be built by running the command below. 

    ./gradlew assemble

The built JAR can be found under `datafu-pig/build/libs` by the name `datafu-pig-x.y.z.jar`, where x.y.z is the version.
    
## Running Tests

All the tests can be run from within eclipse.  However they can also be run from the command line.  To run all the tests:

    ./gradlew test

To run a specific set of tests from the command line, you can define the `test.single` system property.  For example, to run all tests defined in `QuantileTests`:

    ./gradlew :datafu-pig:test -Dtest.single=QuantileTests


{'fraction_non_alphanumeric': 0.06619763351455069, 'fraction_numerical': 0.0009593859929645027, 'mean_word_length': 3.606774668630339, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2362265', 'n_tokens_mistral': 914, 'n_tokens_neox': 863, 'n_words': 422}