python - singer.io 增量负载不起作用
问题描述
与 Singer.io 合作,尝试在 Ubuntu 上使用 xampp 从 mysql 获取数据并能够获取历史数据,但随后我尝试获取代码无法正常工作的增量负载。
如果有人可以提供帮助,我将无法获得 replication_key_value,我将非常感谢您。
配置.json:
{
"host": "localhost",
"port": "3307",
"user": "root",
"password": ""
}
属性.json:
{
"streams": [
{
"tap_stream_id": "test_1-company",
"table_name": "company",
"schema": {
"properties": {
"COMPANY_ID": {
"inclusion": "automatic",
"maxLength": 6,
"type": [
"null",
"string"
]
},
"COMPANY_NAME": {
"inclusion": "available",
"maxLength": 25,
"type": [
"null",
"string"
]
},
"COMPANY_CITY": {
"inclusion": "available",
"maxLength": 25,
"type": [
"null",
"string"
]
}
},
"type": "object"
},
"stream": "company",
"metadata": [
{
"breadcrumb": [],
"metadata": {
"selected-by-default": false,
"database-name": "test_1",
"row-count": 7,
"is-view": false,
"table-key-properties": [
"COMPANY_ID"
],
"replication-method": "INCREMENTAL",
"replication-key": "COMPANY_ID"
}
},
{
"breadcrumb": [
"properties",
"COMPANY_ID"
],
"metadata": {
"selected-by-default": true,
"sql-datatype": "varchar(6)"
}
},
{
"breadcrumb": [
"properties",
"COMPANY_NAME"
],
"metadata": {
"selected-by-default": true,
"sql-datatype": "varchar(25)"
}
},
{
"breadcrumb": [
"properties",
"COMPANY_CITY"
],
"metadata": {
"selected-by-default": true,
"sql-datatype": "varchar(25)"
}
}
]
}
]
}
控制台日志:
$ tap-mysql -c config.json --properties properties.json
INFO Server Parameters: version: 10.4.14-MariaDB, wait_timeout: 2700, innodb_lock_wait_timeout: 2700, max_allowed_packet: 1048576, interactive_timeout: 28800
INFO Server SSL Parameters (blank means SSL is not active): [ssl_version: ], [ssl_cipher: ]
{"type": "STATE", "value": {"currently_syncing": null}}
解决方案
你能分享你的可执行文件吗?您的问题可能出在 state.json 文件中。State.json 需要以下形式:
{
"bookmarks":{
"123po-employee":{
"replication_key":"Id",
"replication_key_value":45,
"version":1609927544221
}
},
"currently_syncing":null
}
推荐阅读
- docker - docker 容器是基于云的吗?
- python - 如何在 pyspark udf 执行器中导入 django rest 框架 api?
- php - DB插入PHP脚本随机冻结,没有错误日志
- forge - 模型衍生端点无法将大 sdb 文件作为块下载
- java - json.simple 无法将字符串转换为 JSONObject 错误
- python - 如何打印 .json url 以进行用户名检索
- if-statement - Shopify Liquid If 商店名称声明
- c - 如何使用 ARM 处理器在定制电路板上执行程序?
- vim - 在 Vim 中设置 oneark 作为配色方案?
- powershell - 在 PowerShell 中使用 IDispatch 调用方法