We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flink-cdc中也有用户指出了类似的问题
TableSchemaBuilder创建Convertor
将字符串转成LocalDateTime
在JdbcValueConvert 中将日期转成UTC long值 JdbcValueConverters.java#L458,关键用了一个非常奇怪的方法转:
public static long toEpochMillis(Object value, TemporalAdjuster adjuster) { if (value instanceof Long) { return (Long) value; } LocalDateTime dateTime = Conversions.toLocalDateTime(value); if (adjuster != null) { dateTime = dateTime.with(adjuster); } // 很想不通为啥这里写死用ZoneOffset.UTC ???硬是把时间拨快了8个小时 return dateTime.toInstant(ZoneOffset.UTC).toEpochMilli(); }
通过添加MySqlDateTimeConverter
并且在SourceChannel中添加如下配置,将以上类中的逻辑注入到Debezium处理binlog Datetime数据类型的逻辑中: https://github.com/qlangtech/plugins/blob/df924d12549a6e11b614837af661ae2ee6965cbd/tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/plugins/incr/flink/cdc/SourceChannel.java#L80
debeziumProperties.put("converters", "datetime"); debeziumProperties.put("datetime.type", "com.qlangtech.plugins.incr.flink.cdc.mysql.MySqlDateTimeConverter"); debeziumProperties.put("datetime.format.date", "yyyy-MM-dd"); debeziumProperties.put("datetime.format.time", "HH:mm:ss"); debeziumProperties.put("datetime.format.datetime", "yyyy-MM-dd HH:mm:ss"); debeziumProperties.put("datetime.format.timestamp", "yyyy-MM-dd HH:mm:ss"); debeziumProperties.put("datetime.format.timestamp.zone", "UTC+8");
The text was updated successfully, but these errors were encountered:
大佬 ,按照您的模式,LATEST 增量模式下是可以解决这个问题的,但是如果我设置为INITIAL, 全量+增量模式,这种情况下这么修改就不生效了,cdc由全量过渡到增量模式下时,增量阶段依然存在这个问题,大佬能指导下怎么解决下吗。
Sorry, something went wrong.
No branches or pull requests
问题如题
flink-cdc中也有用户指出了类似的问题
问题溯源:
TableSchemaBuilder创建Convertor
将字符串转成LocalDateTime
在JdbcValueConvert 中将日期转成UTC long值 JdbcValueConverters.java#L458,关键用了一个非常奇怪的方法转:
解决办法:
通过添加MySqlDateTimeConverter
并且在SourceChannel中添加如下配置,将以上类中的逻辑注入到Debezium处理binlog Datetime数据类型的逻辑中:
https://github.com/qlangtech/plugins/blob/df924d12549a6e11b614837af661ae2ee6965cbd/tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/plugins/incr/flink/cdc/SourceChannel.java#L80
The text was updated successfully, but these errors were encountered: