Reputation: 53
I am getting below error while writing parquet file name 'spark_write_parquet' is not defined
Do I need to import anything to make this command defined? Please help
Upvotes: 0
Views: 694
Reputation: 416
There's no function called spark_write_parquet
! It's always good to at least refer to the documentation and the API first!
df.select("name", "age").write.save("namesAndAges.parquet", format="parquet")
OR
df.write.parquet(os.path.join(tempfile.mkdtemp(), 'data'))
Upvotes: 1