gpt4 book ai didi

postgresql - 查询模式下的kafka jdbc source connector错误

转载 作者:行者123 更新时间:2023-11-29 14:26:59 27 4
gpt4 key购买 nike

<分区>

我在 kafka 中有一个 JDBCSourceConnector,它使用查询从数据库流式传输数据。但是我为选择数据而编写的查询有问题。

我在 Postgres psql 和 DBeaver 中测试了查询。它工作正常,但在 kafka 配置中,它会产生 SQL 语法错误

错误

ERROR Failed to run query for table TimestampIncrementingTableQuerier{name='null', query='select "Users".* from "Users" join "SchoolUserPivots" on "Users".id = "SchoolUserPivots".user_id where school_id = 1 and role_id = 2', topicPrefix='teacher', timestampColumn='"Users".updatedAt', incrementingColumn='id'}: {} (io.confluent.connect.jdbc.source.JdbcSourceTask:221) org.postgresql.util.PSQLException: ERROR: syntax error at or near "WHERE"

配置json

 {
"connector.class": "io.confluent.connect.jdbc.JdbcSourceConnector",
"timestamp.column.name": "\"Users\".updatedAt",
"incrementing.column.name": "id",
"connection.password": "123",
"tasks.max": "1",
"query": "select \"Users\".* from \"Users\" join \"SchoolUserPivots\" on \"Users\".id = \"SchoolUserPivots\".user_id where school_id = 1 and role_id = 2",
"timestamp.delay.interval.ms": "5000",
"mode": "timestamp+incrementing",
"topic.prefix": "teacher",
"connection.user": "user",
"name": "SourceTeacher",
"connection.url": "jdbc:postgresql://ip:5432/school",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"key.converter": "org.apache.kafka.connect.json.JsonConverter"
}

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