{
  "format": "datay-etl-task",
  "version": "1.0",
  "task": {
    "taskName": "MySQL CDC 实时同步到 DuckDB",
    "taskCode": "tmpl_mysql_cdc_to_duckdb",
    "taskDesc": "通过 Binlog 捕获 MySQL 变更并写入本地 DuckDB 数仓。适合单机实时明细层；导入后修改库名、表名与目标 DuckDB 路径。",
    "dir": "/集成模板",
    "type": "ETL",
    "cron": "",
    "retryCount": 0,
    "timeoutSeconds": 0,
    "priority": 2,
    "project": "template",
    "nodes": [
      {
        "label": "采集 MySQL Binlog",
        "code": "n1",
        "desc": "采集 source 库 orders 表的增量变更",
        "type": "MySQLBinlogInput",
        "config": {
          "sourceId": "tmpl-mysql-source",
          "schema": "source",
          "databaseNamePattern": "source",
          "tableNamePattern": "orders",
          "serverId": 1002,
          "snapshot": true,
          "snapshotFetchSize": 10000,
          "reconnectMaxAttempts": 5,
          "reconnectIntervalMs": 3000
        },
        "xAxis": "120",
        "yAxis": "160",
        "status": "0"
      },
      {
        "label": "写入 DuckDB 数仓",
        "code": "n2",
        "desc": "写入模板-DuckDB数仓 main 下与上游同名的表，模式 auto",
        "type": "StreamJdbcOutput",
        "config": {
          "sourceId": "tmpl-duckdb-dw",
          "schema": "main",
          "table": "",
          "model": "auto"
        },
        "xAxis": "560",
        "yAxis": "160",
        "status": "0"
      }
    ],
    "edges": [
      {
        "name": "",
        "code": "e1",
        "source": "n1",
        "target": "n2",
        "config": null,
        "status": "0"
      }
    ]
  },
  "references": {
    "dataSources": [
      {
        "oldId": "tmpl-mysql-source",
        "name": "模板-MySQL源库",
        "type": "MYSQL",
        "url": "jdbc:mysql://127.0.0.1:3306/source?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai"
      },
      {
        "oldId": "tmpl-duckdb-dw",
        "name": "模板-DuckDB数仓",
        "type": "DUCKDB",
        "url": "jdbc:duckdb:./data/template_dw.duckdb"
      }
    ],
    "models": []
  }
}
