Skip to content

Instantly share code, notes, and snippets.

@nordineb
Last active March 31, 2023 07:52
Show Gist options
  • Save nordineb/4b96bbe8412ab1653d8f067f41bdc433 to your computer and use it in GitHub Desktop.
Save nordineb/4b96bbe8412ab1653d8f067f41bdc433 to your computer and use it in GitHub Desktop.
emptysparkpy.py
import os
from pyspark.sql import SparkSession
# Create a SparkSession object
spark = SparkSession.builder.appName("SparkSQL Example").getOrCreate()
# do something to prove it works
rdd = sc.parallelize(range(100000))
x=rdd.sumApprox(3)
print(x)
# Stop the SparkSession
spark.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment