aws胶rds增量载荷

时间:2019-06-06 13:53:38

标签: amazon-web-services etl aws-glue aws-glue-data-catalog

我正在尝试使用AWS胶水将数据从AWS RDS(MySQL)加载到redshift。我想逐步加载数据。通过使用作业书签,胶水只能跟踪新添加的数据,而不能跟踪更新的行。有什么办法可以只加载更新的数据吗?可能是通过使用MySQL源表中的update_at字段?

2 个答案:

答案 0 :(得分:0)

使用工作书签无法做到这一点。从AWS文档中:

Job bookmarks are implemented for a limited use case for a relational database (JDBC connection) input source. For this input source, job bookmarks are supported only if the table's primary keys are in sequential order. Also, job bookmarks search for new rows, but not updated rows. This is because bookmarks look for the primary keys, which already exist.

https://docs.aws.amazon.com/glue/latest/dg/monitor-continuations.html

胶将需要将整个RDS数据加载到动态帧或数据帧中。但是,如果您要避免的是截断redshift表并重新加载所有数据,则可以使用此数据对redshift数据库执行向上插入。

https://docs.aws.amazon.com/redshift/latest/dg/c_best-practices-upsert.html

答案 1 :(得分:0)

您可以使用查询通过过滤源JDBC数据库中的数据来查找更新的记录,如下例所示。我已将date用作参数,因此在此示例中,每次运行我只能从mysql数据库中获取最新值。

例如,请参考this答案

相关问题