You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Robert Metzger (JIRA)" <ji...@apache.org> on 2017/08/20 09:31:00 UTC

[jira] [Updated] (FLINK-7448) Keep the data type unchanged when register an existing field as rowtime

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

Robert Metzger updated FLINK-7448:
----------------------------------
    Component/s: Table API & SQL

> Keep the data type unchanged when register an existing field as rowtime
> -----------------------------------------------------------------------
>
>                 Key: FLINK-7448
>                 URL: https://issues.apache.org/jira/browse/FLINK-7448
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API & SQL
>            Reporter: Jark Wu
>
> Currently, when we convert a DataStream to Table, we can register an existing field as rowtime field. But the rowtime field will become {{TimeIndicator(Timestamp)}} type, not {{TimeIndicator(Long)}} type. It makes user confused that the result becomes Timestamp type not long when select the rowtime field.
> {code}
> // stream schema: [Long, Int, Double, Float], take the first field as rowtime
> val table = stream.toTable(tEnv, 'rowtime.rowtime, 'int, 'double, 'float)
> table.printSchema()
> // - TimeIndicator(Timestamp), Int, Double, Float
> table.select('rowtime)
> // "1970-01-01 00:00:00.007"
> {code}
> Such as in the test {{TimeAttributesITCase#testCalcMaterialization2}}, the original rowtime field is long type, but the selected result becomes timestamp type. Rowtime attribute shouldn't change
> the type, otherwise, the result of batch and stream is not the same.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)