Reputation: 24588
I'm trying to save a data frame to object storage:
print(type(saveDF))
<class 'pyspark.sql.dataframe.DataFrame'>
Then:
saveDF.write().option("header", "true").csv("pre-processed")
Results in:
TypeErrorTraceback (most recent call last)
<ipython-input-90-d20d6b31a2d4> in <module>()
1 ----> saveDF.write().csv("pre-processed")
TypeError: 'DataFrameWriter' object is not callable
I've seen a number of other questions with this problem, but the questions are using a different approach to saving as a csv.
Upvotes: 5
Views: 13499
Reputation: 24588
The issue was a simple fix. Instead of this:
saveDF.write().option("header", "true").csv("pre-processed")
It should have been:
saveDF.write.option("header", "true").csv("pre-processed")
Upvotes: 20