from pyspark import SparkConf, SparkContext from pyspark.sql import SQLContext conf = SparkConf().setAppName(\"Test\").set(\"spark.driver.memory\", \"1g\") sc = Spa
SqlContext.sql expects a valid SQL query not a path to the file. Try this:
SqlContext.sql
with open("/home/ubuntu/workload/queryXX.sql") as fr: query = fr.read() results = sqlContext.sql(query)