Hello

json解析UTC时间是支持的,你with参数里指定下json中timestamp的类型试下, json.timestamp-format.standard 
= 'ISO-8601'

Best
Leonard Xu
[1] 
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/formats/json.html#json-timestamp-format-standard
 
<https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/formats/json.html#json-timestamp-format-standard>

> 在 2020年7月15日,23:19,sunfulin <sunfulin0...@163.com> 写道:
> 
> hi,
> 我通过flink sql 定义了一个es sink,其中有个字段类型定义为了 eventTime TIMESTAMP(9) WITH LOCAL TIME 
> ZONE。
> 在尝试写入时,报了如下的异常。看来json parser无法解析这种类型。请问下大神们,我应该怎么写入一个UTC日期的时间类型?格式类似 
> 2020-07-15T12:00:00.000Z 
> 
> 
> 
> java.lang.UnsupportedOperationException: Not support to parse type: 
> TIMESTAMP(9) WITH LOCAL TIME ZONE
> 
> at 
> org.apache.flink.formats.json.JsonRowDataSerializationSchema.createNotNullConverter(JsonRowDataSerializationSchema.java:184)
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 在 2020-07-15 21:24:30,"sunfulin" <sunfulin0...@163.com> 写道:
>> hi,
>> 我看1.11的java.sql.Timestamp 
>> 对应的是Flink的TIMESTAMP(9),跟之前默认的TIMESTAMP(3)有区别,而且之前1.10的Timestamp(3)是带时区UTC的,现在这个类型不带时区了。想问下这个具体调整应该如何适配?

回复