gpt4 book ai didi

python - tap-mysql 不返回任何数据

转载 作者:行者123 更新时间:2023-12-05 04:05:11 25 4
gpt4 key购买 nike

我一直在使用 singer.io 的 tap-mysql

下面是我的配置文件:

{"host": "localhost","port": "3306","user": "root","password": "password"}

这会在 --discover 上成功返回架构

我的属性文件是:

 {
"streams": [
{
"key_properties": [
"id"
],
"tap_stream_id": "example_db-animals",
"schema": {
"selected": "true",
"properties": {
"likes_getting_petted": {
"selected": "true",
"inclusion": "available",
"type": [
"null",
"boolean"
]
},
"name": {
"selected": "true",
"maxLength": 255,
"inclusion": "available",
"type": [
"null",
"string"
]
},
"id": {
"selected": "true",
"minimum": -2147483648,
"inclusion": "automatic",
"maximum": 2147483647,
"type": [
"null",
"integer"
]
}
},
"type": "object"
},
"table_name": "animals",
"metadata": [
{
"metadata": {
"selected-by-default": true,
"sql-datatype": "int(11)"
},
"breadcrumb": [
"properties",
"id"
]
},
{
"metadata": {
"database-name": "example_db",
"selected-by-default": false,
"is-view": false,
"row-count": 3
},
"breadcrumb": []
},
{
"metadata": {
"selected-by-default": true,
"sql-datatype": "varchar(255)"
},
"breadcrumb": [
"properties",
"name"
]
},
{
"metadata": {
"selected-by-default": true,
"sql-datatype": "tinyint(1)"
},
"breadcrumb": [
"properties",
"likes_getting_petted"
]
}
],
"stream": "animals"
}
]
}

我已经添加了选定的标志。

根据以下命令

$ tap-mysql -c config.json --properties properties.json

我收到了以下回复

{"type": "STATE", "value": {"currently_syncing": null}}

虽然我的表有行

最佳答案

您需要确保在 properties.json 文件中将该表标记为“已选择”。还要确保指定复制方法类型。

下面这部分需要修改

 "metadata": {
"database-name": "example_db",
"selected-by-default": false,
"is-view": false,
"row-count": 3
},
"breadcrumb": []

 "metadata": {
"database-name": "example_db",
"selected-by-default": false,
"is-view": false,
"row-count": 3,
"selected": true,
"replication-method": "FULL_TABLE"
},
"breadcrumb": []

我认为您缺少的两部分是下面的两行:

"selected": true,
"replication-method": "FULL_TABLE"

有关进一步说明,请参阅 GitHub 文档示例:https://github.com/singer-io/tap-mysql#replication-methods-and-state-file

关于python - tap-mysql 不返回任何数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51456910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com