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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Shang Yuanchun (Jira)
Jark Wu created FLINK-7448:
------------------------------

             Summary: 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
            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)