有时我们想要覆盖流的关键属性(主键)或其增量复制键。在 Meltano 执行此操作的最佳方法是什么?
在 Meltano yaml 文件中,您可以使用额外的配置添加table-key-properties和/或replication-key覆盖metadata。
文档参考: https: //docs.meltano.com/concepts/plugins#metadata-extra
示例 yaml 代码:
extractors:
- name: tap-postgres
metadata:
some_stream_id:
table-key-properties: [id]
replication-key: created_at
replication-method: INCREMENTAL
Run Code Online (Sandbox Code Playgroud)
此示例将主键设置为id并将复制键设置为created_at。
根据 @visch 的评论,通配符也可以在流名称中使用,以一次匹配多个流。比如在这些例子中:
extractors:
- name: tap-postgres
metadata:
"*":
# set all streams to "full table" mode
replication-method: FULL_TABLE
Run Code Online (Sandbox Code Playgroud)
和:
extractors:
- name: tap-postgres
metadata:
"*":
# ignore primary keys for all streams
table-key-properties: []
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1368 次 |
| 最近记录: |