Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the pyspark tests were recently changed so that -Phive is no longer strictly necessary to run pyspark tests, but I decided not to address that in this update.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I think we don't necessarily mention it now.

./build/sbt sql/test:compile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, shouldn't we better compile other tests too?

./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