How can I write Pandas dataframe into avro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 03:39 AM
I am trying to write Pandas core dataframe into avro format as below. But I get the following error:
AttributeError: 'DataFrame' object has no attribute 'write'
I have tried several options as below:
df_2018_pd.write.format("com.databricks.spark.avro").save("s3://folder/sub-folder/avro") df_2018_pd.write.format("avro").save("s3://folder/sub-folder/avro") df_2018_pd.write().format("com.databricks.spark.avro").save("s3://folder/sub-folder/avro") df_2018_pd.format("avro").save("s3://folder/sub-folder/avro")
All of the above gives error.
Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2019 05:00 AM
Not sure if you could use something like:
https://github.com/ynqa/pandavro
they have a to_avro which writes pandas to avro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2019 07:59 AM
Yes i saw that pandavro pkg and installed with pip3 but still it did not resolve. So I had to convert into JSON dictionary object and proceed from there. I solved the problem not using Pandas dataframe into AVRO. May be some useful Pandas utility for this will come in future
Thanks for your response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2019 02:15 AM
Very complicated question. I think you can get your answer on online sites. There are many online providers like managements writing solutions whose experts provide online help for every type of research paper. I got a lot of assistance from them. Nowadays it has become very easy to solve any type of questions with the help online websites.

