Answers for "type object 'SparkContext' has no attribute '_jsc'"

0

type object 'SparkContext' has no attribute '_jsc'

import pyspark

conf = pyspark.SparkConf()
# conf.set('spark.app.name', app_name) # Optional configurations

# init & return
sc = pyspark.SparkContext.getOrCreate(conf=conf)
sqlcontext = SQLContext(sc)

df = sqlcontext.read.json('random.json')
Posted by: Guest on September-17-2021

Code answers related to "type object 'SparkContext' has no attribute '_jsc'"

Python Answers by Framework

Browse Popular Code Answers by Language