flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JingsongLee" <lzljs3620...@aliyun.com>
Subject Re: Flink Table API and Date fields
Date Mon, 08 Jul 2019 02:06:35 GMT
Hi Flavio:
Looks like you use java.util.Date in your pojo, Now Flink table not support BasicTypeInfo.DATE_TYPE_INFO
because of the limitations of some judgments in the code.
 Can you use java.sql.Date? 

Best, JingsongLee

From:Flavio Pompermaier <pompermaier@okkam.it>
Send Time:2019年7月5日(星期五) 22:52
To:user <user@flink.apache.org>
Subject:Flink Table API and Date fields

Hi to all,
in my use case I have a stream of POJOs with Date fields.
When I use Table API I get the following error:

Exception in thread "main" org.apache.flink.table.api.ValidationException: SQL validation
failed. Type is not supported: Date
 at org.apache.flink.table.calcite.FlinkPlannerImpl.validate(FlinkPlannerImpl.scala:112)
 at org.apache.flink.table.planner.StreamPlanner.toRel(StreamPlanner.scala:148)
 at org.apache.flink.table.planner.StreamPlanner.parse(StreamPlanner.scala:114)
 at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlQuery(TableEnvironmentImpl.java:268)
Caused by: org.apache.flink.table.api.TableException: Type is not supported: Date
 at org.apache.flink.table.calcite.FlinkTypeFactory$.org$apache$flink$table$calcite$FlinkTypeFactory$$typeInfoToSqlTypeName(FlinkTypeFactory.scala:357)

Is there a way to deal with this without converting the Date field to a Long one?

View raw message