更新时间:2023-01-24 12:14:10
我找到了答案.
timestampFormat的默认值为yyyy-MM-dd'T'HH:mm:ss.SSSXXX
,这是一个非法参数.写数据框时需要设置它.
The default for the timestampFormat is yyyy-MM-dd'T'HH:mm:ss.SSSXXX
which is an illegal argument. It needs to be set when you are writing the dataframe out.
解决方法是将其更改为ZZ,其中将包含时区.
The fix is to change that to ZZ which will include the timezone.
df.write
.option("timestampFormat", "yyyy/MM/dd HH:mm:ss ZZ")
.mode(SaveMode.Overwrite)
.csv("my.csv")