How to locally submit Apache Spark jobs explained

Johan Louwers
16 min readApr 18, 2024
Submit your Apache Spark job locally

Once you’ve set up your Apache Spark cluster and crafted the logic you wish to execute, the next natural step is to submit your job to the Apache Spark master node. One straightforward approach is to use a command line submission method directly from your local environment. While this method lacks scalability and isn’t ideal for production-level use, it serves as an excellent means to verify the fundamental functionality of your Apache Spark installation.

A basic Apache Spark job

The following Python script showcases an Apache Spark job. Its purpose is to decipher a Caesar cipher encrypted text by computing all potential shifts and identifying the result set that includes the name of a capital city.

A Caesar shift, named after Julius Caesar, is a type of substitution cipher used in cryptography. In this technique, each letter in the plaintext is shifted a certain number of places down or up the alphabet. For example, with a shift of 3, ‘A’ would be replaced by ‘D’, ‘B’ would become ‘E’, and so on. The recipient of the message knows the shift value and can easily decrypt the message by reversing the shift. This method provides a basic level of security and was commonly used in ancient times for military and diplomatic communications.

from pyspark.sql import…

--

--

Johan Louwers

Johan Louwers is a technology enthousiasts with a long background in supporting enterprises and startups alike as CTO, Chief Enterprise Architect and developer.