写个 UDF 再把 1970-01-01T00:00 转回去?

On Wed, 11 Nov 2020 at 14:38, 丁浩浩 <18579099...@163.com> wrote:

> 当我mysql字段时datetime并且字段值是0000-00-00
> 00:00:00时,会被转成1970-01-01T00:00,如果我应该如何操作才能保证跟原数值保持一致?
> 输出的结果:
> 2> (true,1,zhangsan,18,1970-01-01T00:00)
> 3> (true,2,lisi,20,2020-11-11T14:17:46)
> 4> (true,3,wangwu,99,1970-01-01T00:00)
> 1> (true,4,zhaoliu,77,1970-01-01T00:00)
> 日志信息:
> 2020-11-11 14:30:37,418 - 19755 WARN
> [debezium-mysqlconnector-mysql_binlog_source-snapshot]
> io.debezium.connector.mysql.MySqlValueConverters:852  - Invalid value
> '0000-00-00 00:00:00' stored in column 'rigist_time' of table 'test.boos'
> converted to empty value
> 2020-11-11 14:30:37,424 - 19761 WARN
> [debezium-mysqlconnector-mysql_binlog_source-snapshot]
> io.debezium.connector.mysql.MySqlValueConverters:852  - Invalid value
> '0000-00-00 00:00:00' stored in column 'rigist_time' of table 'test.boos'
> converted to empty value
> 2020-11-11 14:30:37,424 - 19761 WARN
> [debezium-mysqlconnector-mysql_binlog_source-snapshot]
> io.debezium.connector.mysql.MySqlValueConverters:852  - Invalid value
> '0000-00-00 00:00:00' stored in column 'rigist_time' of table 'test.boos'
> converted to empty value
>
>
>

回复