spark README

The project's README from github.com/apache/spark. As one markdown file: README.md.

Apache Spark

Spark is a unified analytics engine for large-scale data processing. It provides high-level APIs in Scala, Java, Python, and R (Deprecated), and an optimized engine that supports general computation graphs for data analysis. It also supports a rich set of higher-level tools including Spark SQL for SQL and DataFrames, pandas API on Spark for pandas workloads, MLlib for machine learning, GraphX for graph processing, and Structured Streaming for stream processing.

License Maven Central Java GitHub Actions Build PySpark Coverage PyPI Downloads

Online Documentation

You can find the latest Spark documentation, including a programming guide, on the project web page. This README file only contains basic setup instructions.

Build Pipeline Status

Branch Status
master GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
branch-4.x GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
branch-4.3 GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
branch-4.2 GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
branch-4.1 GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
branch-4.0 GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
GitHub Actions Build
branch-3.5 GitHub Actions Build
GitHub Actions Build
GitHub Actions Build

Building Spark

Spark is built using Apache Maven. To build Spark and its example programs, run:

./build/mvn -DskipTests clean package

(You do not need to do this if you downloaded a pre-built package.)

More detailed documentation is available from the project site, at "Building Spark".

For general development tips, including info on developing Spark using an IDE, see "Useful Developer Tools".

Interactive Scala Shell

The easiest way to start using Spark is through the Scala shell:

./bin/spark-shell

Try the following command, which should return 1,000,000,000:

scala> spark.range(1000 * 1000 * 1000).count()

Interactive Python Shell

Alternatively, if you prefer Python, you can use the Python shell:

./bin/pyspark

And run the following command, which should also return 1,000,000,000:

>>> spark.range(1000 * 1000 * 1000).count()

Example Programs

Spark also comes with several sample programs in the examples directory. To run one of them, use ./bin/run-example <class> [params]. For example:

./bin/run-example SparkPi

will run the Pi example locally.

You can set the MASTER environment variable when running examples to submit examples to a cluster. This can be spark:// URL, "yarn" to run on YARN, and "local" to run locally with one thread, or "local[N]" to run locally with N threads. You can also use an abbreviated class name if the class is in the examples package. For instance:

MASTER=spark://host:7077 ./bin/run-example SparkPi

Many of the example programs print usage help if no params are given.

Running Tests

Testing first requires building Spark. Once Spark is built, tests can be run using:

./dev/run-tests

Please see the guidance on how to run tests for a module, or individual tests.

There is also a Kubernetes integration test, see resource-managers/kubernetes/integration-tests/README.md

A Note About Hadoop Versions

Spark uses the Hadoop core library to talk to HDFS and other Hadoop-supported storage systems. Because the protocols have changed in different versions of Hadoop, you must build Spark against the same version that your cluster runs.

Please refer to the build documentation at "Specifying the Hadoop Version and Enabling YARN" for detailed guidance on building for a particular distribution of Hadoop, including building for particular Hive and Hive Thriftserver distributions.

Configuration

Please refer to the Configuration Guide in the online documentation for an overview on how to configure Spark.

Contributing

Please review the Contribution to Spark guide for information on how to get started contributing to the project.

spark (apache/spark)

Searching Database…

44.2K ·GitHub
Что это такое?Apache Spark — это единый движок аналитики для обработки больших объёмов данных. Он предлагает высокоуровневые API для Scala, Java, Python и R поверх оптимизированного движка выполнения.
Это библиотека, которую я подключаю в код, или сервис, который я запускаю?Это движок, на основе которого вы строите свои приложения, и в комплекте с ним идут инструменты более высокого уровня: Spark SQL для работы с SQL и DataFrame, pandas API для задач в стиле pandas, MLlib, GraphX и Structured Streaming.
Как мне увидеть, что он реально что-то делает?Скачайте официальный релиз и запустите пример из комплекта — классический вариант это пример с Pi; многие примеры выводят справку по использованию, если запустить их без параметров.
Есть ли подводные камни при работе с хранилищем Hadoop?Да — Spark использует библиотеку Hadoop core для доступа к HDFS и другим хранилищам с поддержкой Hadoop, и собирать Spark нужно под ту же версию Hadoop, что стоит на вашем кластере.
Мне для этого нужен целый кластер или хватит ноутбука?Ноутбука достаточно — примеры запускаются локально в один поток или с несколькими потоками через local[N].
А когда мне станет тесно на ноутбуке, как направить его на настоящий кластер?Задайте переменную окружения MASTER при запуске примеров: URL вида spark:// или значение 'yarn' отправит задачу на кластер.
R API помечен как устаревший — стоит ли начинать с ним новый проект?В README язык R перечислен среди высокоуровневых API, но с пометкой '(Deprecated)', поэтому для новых проектов лучше выбрать Scala, Java или Python.
Может ли Spark работать на Kubernetes?Да — в репозитории есть интеграция с Kubernetes в каталоге resource-managers/kubernetes со своим README по интеграционным тестам, хотя в основном README она упоминается только в контексте тестирования.
Он работает с Hive?Да — документация по сборке описывает сборку под конкретные дистрибутивы Hive и Hive Thriftserver, так что поддержка Hive зависит от того, под каким дистрибутивом для вашего кластера вы соберёте Spark.
What are similar projects?trino, BigData-Notes, flink, presto, doris, dask, xgboost, modin
Creator
apache
Size
610 MB
Stars
44.2K
Updated
CommitOct 17
Age
12y
Commits · 90 Days