hi, leonard
感谢回复。我在es的ddl with参数里加了这个,貌似还是报错。我再简单描述下我的场景:
我的es sink的ddl如下:
create table es_sink (
  a varchar,
  b varchar,
  c TIMESTAMP(9) WITH LOCAL TIME ZONE
) with (
  ....
)


我使用处理时间属性,将流里的proctime转成UTC格式的日期类型,作为c这个字段写入。现在能原生支持么?之前在1.10版本貌似是可以直接写的。但是到1.11写的不带时区了,导致不能兼容之前的格式。














在 2020-07-16 09:40:06,"Leonard Xu" <xbjt...@gmail.com> 写道:
>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的,现在这个类型不带时区了。想问下这个具体调整应该如何适配?
>

回复