env {
  execution.parallelism = 1
  job.mode = "BATCH"
  checkpoint.interval = 5000
  #execution.checkpoint.data-uri = "hdfs://localhost:9000/checkpoint"
}

source {
  jdbc{
    result_table_name = "fake1"
    url = "jdbc:mysql://localhost:3306/digital_operation"
    driver = "com.mysql.cj.jdbc.Driver"
    connection_check_timeout_sec = 100
    user = "root"
    password = "123456"
    query = "select * from test_copy"
  }
}

transform {
    # 这是一种写法，多列有相同值需要替换成相同的值可以使用这个
#     Replace-list {
#         source_table_name = "fake"
#         result_table_name = "fake1"
#         replace_field = "name,address"
#         pattern = "null"
#         replacement = "测试替换"
#       }
    # 如果多列的数据不一致，并且替换的值也不一致那么使用下面的配置
    Replace-list {
        source_table_name = "fake"
        result_table_name = "fake1"
        replace_field = "name,address,age"
        pattern = "null,null,20"
        replacement = "Tom,郑州,18"
    }
}

sink {
  jdbc {
    source_table_name = "fake"
    url = "jdbc:mysql://localhost:3306/testdb"
    driver = "com.mysql.cj.jdbc.Driver"
    user = "root"
    password = "123456"
    query = "insert into test_copy(id, name, address, sex, age) values(?, ?, ?, ?, ?)"
    batch_size = 1000
  }
}
