Fabian Hueske created FLINK-8853:
------------------------------------

             Summary: 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 & SQL
    Affects Versions: 1.5.0
            Reporter: Fabian Hueske
             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)

Reply via email to