Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
1.10.0
-
None
Description
When I set rowtime attribute by using expression 'column.rowtime' , and result type is sql.Timestamp, the result will have lag which is equals with default timezone offset.
tEnv.fromDataStream(stream, "user_action_time.rowtime, user_name, data");
I look into the conversion logic, the field was go through 'long -> SqlTimestamp -> Timestamp' conversion.
long from = System.currentTimeMillis(); long to = SqlTimestamp .fromEpochMillis(from) .toTimestamp() .getTime();
The result is from!=to. In SqlTimestamp.toTimestamp() using Timestamp.valueOf(LocalDateTime dateTime) which is contain timezone infomation, will casue time lag.
From Timestamp to Timestamp not have this issue, but convert Datastream to Table is use StreamRecord.timestamp as rowtime field.
Attachments
Issue Links
- relates to
-
FLINK-20162 Fix time zone problems for some time related functions
-
- Closed
-