Flink深入浅出:JDBC Source从理论到实战
1 表定义
jdbc表的定义跟普通的表定义,区别就在于with中的参数:
CREATE TABLE MyUserTable ( ... ) WITH (
'connector.type' = 'jdbc',
'connector.url' = 'jdbc:mysql://localhost:3306/flink-test',
'connector.table' = 'jdbc_table_name',
'connector.driver' = 'com.mysql.jdbc.Driver',
'connector.username' = 'name',
'connector.password' = 'password',
-- 以上都是必填参数
'connector.read.partition.column' = 'column_name',
'connector.read.partition.num' = '50',
'connector.read.partition.lower-bound' = '500',
'connector.read.partition.upper-bound' = '1000',
'connector.read.fetch-size' = '100'
)
相关文章