This topic describes how to develop a Spark on MaxCompute application by Java or Scala.

Download a demo project

Spark on MaxCompute provides a demo project template. We recommend that you download and copy the template to delevelop your application.

Run the following commands to download the demo project.
git clone git@github.com:aliyun/aliyun-cupid-sdk.git
cd aliyun-cupid-sdk
git checkout 3.3.3-public
# Spark-2.x demo project directory.
cd spark/spark-2.x/spark-examples
# Spark-1.x demo project directory.
cd spark/spark-1.x/spark-examples
# Pack and generate a shaded JAR package in your target directory.
mvn clean package
Notice In the demo project, the scope parameter for the Spark dependency is set to provided. Do not modify this parameter, otherwise the submitted job will not run normally.

Spark-1.x examples

Spark-2.x examples