Hello World

One nice thing about Spark is that under the hood, it's basically just a SQL dialect.

(Example notebook can be found here)

Python

from pyspark.sql import SparkSession

# 1) Create a spark context
spark = SparkSession.builder.getOrCreate()

# 2) You can use `sql()` to write raw sql queries
df = spark.sql("SELECT 'Hello World' as column_1")

# 3) You can use `show()` to print your dataframe
df.show()

#  +-----------+
#  |   column_1|
#  +-----------+
#  |Hello World|
#  +-----------+