[英]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.