Reputation: 359
While printing the schema of a SQL database,I am getting the following error:
Upvotes: 1
Views: 5107
Reputation: 2982
Use SparkSession instead of SQLContext. So do:
sqlContext = SparkSession.builder.master("local[*]").appName("appName").
config("spark.sql.warehouse.dir", "./spark-warehouse").getOrCreate()
The rest of your code should work normally.
You may adjust the variable name from sqlContext
to reflect the reference held.
Upvotes: 2