Spark Guide
Also available as:
loading table of contents...

Chapter 9. Adding Libraries to Spark

To use a custom library with a Spark application (a library that is not available in Spark by default, such as a compression library or Magellan), use one of the following two spark-submit script options:

  • The --jars option transfers associated jar files to the cluster.

  • The --packages option pulls directly from Spark packages. This approach requires an internet connection.

For example, to add the LZO compression library to Spark using the --jars option:

spark-submit --driver-memory 1G --executor-memory 1G --master yarn-client --jars /usr/hdp/

For more information about the two options, see Advanced Dependency Management in the Apache Spark "Submitting Applications" document.