Mortar has joined Datadog, the leading SaaS-based monitoring service for cloud applications. Read more about what this means here.

Start a Spark Script

To run your Spark script on Mortar, you'll need to place the script in the sparkscripts directory of a Mortar project. For the purposes of this tutorial, you may find it most convenient to use Mortar's example project, which contains a finished version of the Spark script that you can run right out of the box or use to check your work as you follow the tutorial. You can get a copy of the example project by running the following command in the terminal, prepending your handle to generate a unique name:

mortar projects:fork git@github.com:mortardata/mortar-examples.git <your-handle>-mortar-examples

The finished, ready-to-run version of the Spark script is available for your reference in the example project’s sparkscripts directory: sparkscripts/text-classifier-complete.py.

(If you haven't yet installed the Mortar Development Framework on your machine, you can get it here.)

Create a New Spark Script

Now that you have a project to work with, you're ready to start writing your own Spark script.

ACTION: In your favorite code editor, create a new blank file called text-classifier.py in the sparkscripts directory of your project.

Now you're ready to write your script.