简体   繁体   English

如何使用Python从S3文件覆盖DynamoDB表?

[英]How can I use Python to overwrite a DynamoDB table from an S3 file?

I have built queries using HIVE to pull specific data and I have it stored in S3. 我已经使用HIVE构建查询来提取特定数据,并将其存储在S3中。 I tried to use HIVE to overwrite data stored in a Dynamo table, but it will not allow it to overwrite the data. 我尝试使用HIVE覆盖Dynamo表中存储的数据,但不允许它覆盖数据。 Can I use Python to update the Dynamo table from the data stored in S3? 我可以使用Python从S3中存储的数据更新Dynamo表吗?

This is possible with hive itself. 蜂巢本身可以做到这一点。

You need to: "Before importing, ensure that the table exists in DynamoDB and that it has the same key schema as the previously exported DynamoDB table. If an item with the same key exists in the target DynamoDB table, it will be overwritten. If no item with the key exists in the target DynamoDB table, the item is inserted.". 您需要:“在导入之前,请确保该表存在于DynamoDB中,并且与先前导出的DynamoDB表具有相同的键架构。如果目标DynamoDB表中存在具有相同键的项,则它将被覆盖。如果目标DynamoDB表中不存在带有键的项目,则插入该项目。”。

There are various examples here - look for importing Hive Command Examples for Exporting, Importing, and Querying Data in DynamoDB 这里有各种示例-寻找导入Hive命令的示例,以在DynamoDB中导出,导入和查询数据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Lambda 和 Python 在 AWS s3 中读取和覆盖文件? - How to read and overwrite a file in AWS s3 using Lambda and Python? 如何使用python从带有签名和有效期的链接中下载S3文件? - How do I use python to download an S3 file from a link with a signature and expiration? 如何使用 Python 从公共 AWS S3 存储桶中提取文件 - How can I extract file from the public AWS S3 bucket with Python 如何使用 python 从 S3 存储桶读取 .txt 文件并查看内容? - How can I read .txt file from S3 bucket using python and view the contents? 如何在DynamoDB(Python)中的嵌套属性上使用FilterExpression? - How can i use FilterExpression over Nested Attributes in DynamoDB (Python)? 使用Python从S3 CSV文件复制Redshift表? - Copy Redshift table from S3 csv file using Python? 如何从s3读取CSV文件并使用python lambda函数将内容写入RDS数据库表中? - How to read a CSV file from s3 and write the content in RDS database table using python lambda function? 如何从表中获取所有列并将其保存为python中的csv文件在s3中 - How to fetch all columns from table and save it in s3 as csv file using python 我如何在python中使用amazon s3来使用REST示例 - How i use amazon s3 in python to use REST examples 我如何使用 aws lambda 将文件写入 s3 (python)? - How could I use aws lambda to write file to s3 (python)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM