FlinkCDC 3.2.0 新增优点 Pattern Replacement in routing rules

新增优点:Pattern Replacement in routing rules

flinkcdc 3.2.0版本相较于3.1.0版本,避免了多表多sink多次写 route 路由的麻烦,类似于统一前后缀的形式多表多sink,通过<>正则,大大减少了书写

官网:
Route | Apache Flink CDC

Pattern Replacement in routing rules #

If you'd like to route source tables and rename them to sink tables with specific patterns, replace-symbol could be used to resemble source table names like this:

复制代码
route:
  - source-table: source_db.\.*
    sink-table: sink_db.<>
    replace-symbol: <>
    description: route all tables in source_db to sink_db

Then, all tables including source_db.XXX will be routed to sink_db.XXX without hassle.

包括source_db.XXX在内的所有表都将毫无麻烦地路由到sink_db.XXX

应用:

flinkcdc版本升级 mysql to doris 在 lib 下添加依赖jar包:

html 复制代码
source:
  type: mysql
  hostname: xxx
  port: 3306
  username: root
  password: xxx
  tables: adb.\.*,bdb.\.*
  server-id: 6410-6490
  server-time-zone: Asia/Shanghai
  scan.startup.mode: latest-offset

sink:
  type: doris
  fenodes: xxx:8130,xxx:8130,xxx:8130
  username: root
  password: xxx
  table.create.properties.light_schema_change: true

route:
  - source-table: adb.\.*
    sink-table: test_sync.adb_db_<>
    replace-symbol: <>

pipeline:
  name: test_sync
  parallelism: 1

adb会根据route路由规则进行整库同步,bdb则会根据默认的无路由规则进行整库同步。

flinkcdc pipeline 数据库仍然需要在起任务前提前创建好,表则会在source初始阶段自动创建,表注释仍然不生效

相关推荐
历程里程碑11 分钟前
双指针2--盛水最多的容器
大数据·数据结构·算法·leetcode·elasticsearch·搜索引擎·散列表
川西胖墩墩28 分钟前
智能交通管理:实时路况优化与拥堵预测
大数据
重生之绝世牛码35 分钟前
Linux软件安装 —— PostgreSQL高可用集群安装(postgreSQL + repmgr主从复制 + keepalived故障转移)
大数据·linux·运维·数据库·postgresql·软件安装·postgresql高可用
电商API&Tina1 小时前
电商API接口的应用与简要分析||taobao|jd|微店
大数据·python·数据分析·json
不会c+3 小时前
Elasticsearch入门
大数据·elasticsearch·搜索引擎
数据知道3 小时前
PostgreSQL 实战:一文掌握如何优雅的进行递归查询?
大数据·数据库·postgresql
Hello.Reader3 小时前
Flink 2.2 Docker 部署Session / Application / SQL Client 一把梭(含 Compose、插件、连接器与踩坑点)
sql·docker·flink
重生之绝世牛码3 小时前
Linux软件安装 —— ClickHouse单节点安装(rpm安装、tar安装两种安装方式)
大数据·linux·运维·数据库·clickhouse·软件安装·clickhouse单节点
AIFQuant3 小时前
如何通过股票数据 API 计算 RSI、MACD 与移动平均线MA
大数据·后端·python·金融·restful
MasonYyp4 小时前
DSPy优化提示词
大数据·人工智能