Spark读取Hudi写入ClickHouse遇到的时间格式问题

spark读hudi写clickhouse的时区问题

spark读hudi里的时间格式字符串时,使用了data_format进行时间格式化操作,在操作的过程中,会自动进行时区的转换,实际上不需要处理。

date_format(hudi.posted_date, 'yyyy-MM-dd HH:mm:ss')

下面两个字符串,一个使用date_format,一个使用substr进行直接截取,使用date_format的进行了时区转换。

replace(substr(hudi.f_start_locale,0,19),'T',' ')

在这里插入图片描述

以上是原始数据。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/epitomizelu/article/details/120866022