[英]How to write a pandas dataframe to AWS Athena table using python script
I am having dataframe like below我有如下所示的数据框
Rate.head(4)
KG Europe_Rate NAP_Rate
1 10 8
2 16 12
3 19 16
4 22 18
I want insert this data into AWS table.我想将此数据插入 AWS 表中。 How can this be done?如何才能做到这一点?
Database: Rate
Table :Customer_Rate
The columns types in AWS athena is double ( KG, Europe_Rate, NAP_Rate). AWS athena 中的列类型是双精度的(KG、Europe_Rate、NAP_Rate)。
AWS Athena queries data on S3. AWS Athena 在 S3 上查询数据。 It supports many different types of data such as CSV, JSON, Parquet, etc. If you write your data frame as a CSV to an S3 bucket and then create a table in Athena you will be able to query the data with Athena.它支持许多不同类型的数据,例如 CSV、JSON、Parquet 等。如果您将数据帧作为 CSV 写入 S3 存储桶,然后在 Athena 中创建表,您将能够使用 Athena 查询数据。 You can find an example of how to create a table that reads CSV data here: https://docs.aws.amazon.com/athena/latest/ug/lazy-simple-serde.html您可以在此处找到有关如何创建读取 CSV 数据的表的示例: https : //docs.aws.amazon.com/athena/latest/ug/lazy-simple-serde.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.