Skip to content
Discussion options

You must be logged in to vote

autoPk 的引入,是通过程序自动猜测可用于表拆分的字段,他首先会获取指定表中具有主键、单字段唯一索引索引的字段,如果有多个字段符合要求,则优先使用数字类型的字段,其次使用字符类型的字段。
其配置很简单,只需要在 任务配置文件中增加如下配置即可:

{
  "job": {
    "setting": {
      "speed": {
        "channel": 3,
        "bytes": -1
      }
    },
    "content": {
      "reader": {
        "name": "mysqlreader",
        "parameter": {
          "username": "root",
          "password": "root",
          "autoPk":"true",
          "column": [
            "*"
          ],
          "connection": {
            "table": [
              "addax_reader"
            ],
            "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/test",
            "driver": "com.mysql.jdbc.Driver"
          }
        }
      },
      "writer"

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by wgzhao
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@weihebu
Comment options

@wgzhao
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #1262 on April 14, 2025 08:40.