1import pyspark
2
3conf = pyspark.SparkConf()
4# conf.set('spark.app.name', app_name) # Optional configurations
5
6# init & return
7sc = pyspark.SparkContext.getOrCreate(conf=conf)
8sqlcontext = SQLContext(sc)
9
10df = sqlcontext.read.json('random.json')