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

source {
  Http {
      url = "http://fine-doc.oss-cn-shanghai.aliyuncs.com/book.json"
      method = "GET"
      format = "json"
      result_table_name = "fake"
      json_field = {
        category = "$.store.book[*].category"
        author = "$.store.book[*].author"
        title = "$.store.book[*].title"
        price = "$.store.book[*].price"
      }
      schema = {
        fields {
          category = string
          author = string
          title = string
          price = string
        }
      }
    }
}

transform {}

sink {
  jdbc {
    source_table_name = ["fake"]
    url = "jdbc:mysql://localhost:3306/test_db"
    driver = "com.mysql.cj.jdbc.Driver"
    user = "root"
    password = "root"
    query = "insert into test_book(category, author, title, price) values(?, ?, ?, ?)"
    batch_size = 1000
  }
}
