Flink Connector常见问题

可以在Flink sink表中配置时区参数'server-time-zone' = 'Asia/Shanghai',或同时在jdbc url里添加&serverTimezone=Asia/Shanghai。示例如下:

CREATE TABLE sk (
    sid int,
    local_dtm TIMESTAMP,
    curr_dtm TIMESTAMP
)
WITH (
    'connector' = 'jdbc',
    'url' = 'jdbc:mysql://192.168.110.66:9030/sys_device?characterEncoding=utf-8&serverTimezone=Asia/Shanghai',
    'table-name' = 'sink',
    'driver' = 'com.mysql.jdbc.Driver',
    'username' = 'doris',
    'password' = 'doris123',
    'server-time-zone' = 'Asia/Shanghai'
);