You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (JIRA)" <ji...@apache.org> on 2018/03/04 19:17:00 UTC

[jira] [Assigned] (FLINK-8853) SQL Client cannot emit query results that contain a rowtime attribute

     [ https://issues.apache.org/jira/browse/FLINK-8853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Walther reassigned FLINK-8853:
-----------------------------------

    Assignee: Timo Walther

> SQL Client cannot emit query results that contain a rowtime attribute
> ---------------------------------------------------------------------
>
>                 Key: FLINK-8853
>                 URL: https://issues.apache.org/jira/browse/FLINK-8853
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>    Affects Versions: 1.5.0
>            Reporter: Fabian Hueske
>            Assignee: Timo Walther
>            Priority: Blocker
>             Fix For: 1.5.0
>
>
> Emitting a query result that contains a rowtime attribute fails with the following exception:
> {code:java}
> Caused by: java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.lang.Long
>     at org.apache.flink.api.common.typeutils.base.LongSerializer.serialize(LongSerializer.java:27)
>     at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:160)
>     at org.apache.flink.api.java.typeutils.runtime.RowSerializer.serialize(RowSerializer.java:46)
>     at org.apache.flink.api.java.typeutils.runtime.TupleSerializer.serialize(TupleSerializer.java:125)
>     at org.apache.flink.api.java.typeutils.runtime.TupleSerializer.serialize(TupleSerializer.java:30)
>     at org.apache.flink.streaming.experimental.CollectSink.invoke(CollectSink.java:66)
>     ... 44 more{code}
> The problem is cause by the {{ResultStore}} which configures the {{CollectionSink}} with the field types obtained from the {{TableSchema}}. The type of the rowtime field is a {{TimeIndicatorType}} which is serialized as Long. However, in the query result it is represented as Timestamp. Hence, the type must be replaced by a {{SqlTimeTypeInfo<Timestamp>}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)