- Notifications
You must be signed in to change notification settings - Fork0
zhagnlu/spark
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Spark is a fast and general cluster computing system for Big Data. It provideshigh-level APIs in Scala, Java, Python, and R, and an optimized engine thatsupports general computation graphs for data analysis. It also supports arich set of higher-level tools including Spark SQL for SQL and DataFrames,MLlib for machine learning, GraphX for graph processing,and Spark Streaming for stream processing.
You can find the latest Spark documentation, including a programmingguide, on theproject web pageandproject wiki.This README file only contains basic setup instructions.
Spark is built usingApache 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 developing Spark using an IDE, seeEclipseandIntelliJ.
The easiest way to start using Spark is through the Scala shell:
./bin/spark-shell
Try the following command, which should return 1000:
scala> sc.parallelize(1 to 1000).count()
Alternatively, if you prefer Python, you can use the Python shell:
./bin/pyspark
And run the following command, which should also return 1000:
>>> sc.parallelize(range(1000)).count()
Spark also comes with several sample programs in theexamples
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 submitexamples to a cluster. This can be a mesos:// or spark:// URL,"yarn" to run on YARN, and "local" to runlocally with one thread, or "local[N]" to run locally with N threads. Youcan also use an abbreviated class name if the class is in theexamples
package. For instance:
MASTER=spark://host:7077 ./bin/run-example SparkPi
Many of the example programs print usage help if no params are given.
Testing first requiresbuilding Spark. Once Spark is built, testscan be run using:
./dev/run-tests
Please see the guidance on how torun tests for a module, or individual tests.
Spark uses the Hadoop core library to talk to HDFS and other Hadoop-supportedstorage systems. Because the protocols have changed in different versions ofHadoop, you must build Spark against the same version that your cluster runs.
Please refer to the build documentation at"Specifying the Hadoop Version"for detailed guidance on building for a particular distribution of Hadoop, includingbuilding for particular Hive and Hive Thriftserver distributions.
Please refer to theConfiguration Guidein the online documentation for an overview on how to configure Spark.
About
Mirror of Apache Spark
Resources
License
Security policy
Stars
Watchers
Forks
Packages0
Languages
- Scala77.6%
- Java9.7%
- Python8.0%
- R2.7%
- Shell0.7%
- GAP0.6%
- Other0.7%