以下代码以前可以运行,但现在不行了。我遇到了如下错误:
AttributeError: 'DataFrame' object has no attribute 'toDF'
if __name__ == "__main__":
sc = SparkContext(appName="test")
sqlContext = SQLContext(sc)
df = sqlContext.read.format('com.databricks.spark.csv').\
options(header='false',delimiter=',',inferSchema='true').load('test')
### rename columns
df = df.toDF('a','b','c')
...
sc.stop()