Skip to content

Commit

Permalink
[SPARK-23776][DOC] Update instructions for running PySpark after buil…
Browse files Browse the repository at this point in the history
…ding with SBT

## What changes were proposed in this pull request?

This update tells the reader how to build Spark with SBT such that pyspark-sql tests will succeed.

If you follow the current instructions for building Spark with SBT, pyspark/sql/udf.py fails with:
<pre>
AnalysisException: u'Can not load class test.org.apache.spark.sql.JavaStringLength, please make sure it is on the classpath;'
</pre>

## How was this patch tested?

I ran the doc build command (SKIP_API=1 jekyll build) and eyeballed the result.

Author: Bruce Robbins <[email protected]>

Closes apache#21628 from bersprockets/SPARK-23776_doc.
  • Loading branch information
bersprockets authored and HyukjinKwon committed Jun 26, 2018
1 parent d48803b commit 4c059eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/building-spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,23 @@ If you are building Spark for use in a Python environment and you wish to pip in

Alternatively, you can also run make-distribution with the --pip option.

## PySpark Tests with Maven
## PySpark Tests with Maven or SBT

If you are building PySpark and wish to run the PySpark tests you will need to build Spark with Hive support.

./build/mvn -DskipTests clean package -Phive
./python/run-tests

If you are building PySpark with SBT and wish to run the PySpark tests, you will need to build Spark with Hive support and also build the test components:

./build/sbt -Phive clean package
./build/sbt test:compile
./python/run-tests

The run-tests script also can be limited to a specific Python version or a specific module

./python/run-tests --python-executables=python --modules=pyspark-sql

**Note:** You can also run Python tests with an sbt build, provided you build Spark with Hive support.

## Running R Tests

To run the SparkR tests you will need to install the [knitr](https://cran.r-project.org/package=knitr), [rmarkdown](https://cran.r-project.org/package=rmarkdown), [testthat](https://cran.r-project.org/package=testthat), [e1071](https://cran.r-project.org/package=e1071) and [survival](https://cran.r-project.org/package=survival) packages first:
Expand Down

0 comments on commit 4c059eb

Please sign in to comment.