lamber-ken edited a comment on issue #7180: [FLINK-11010] [TABLE] Flink SQL timestamp is inconsistent with currentProcessingTime() URL: https://github.com/apache/flink/pull/7180#issuecomment-441977232 more discussion details, please read [Question about Timestamp in Flink SQL ](http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Question-about-Timestamp-in-Flink-SQL-td16928.html) ## minimal reproducible example ``` public static void main(String[] args) throws Exception { StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); StreamTableEnvironment tableEnv = TableEnvironment.getTableEnvironment(env); DataStreamSource<String> socket = env.socketTextStream("localhost", 9999); tableEnv.registerDataStream("orders", socket, "user,proctime.proctime"); Table result = tableEnv.sqlQuery("select proctime from orders"); tableEnv .toRetractStream(result, TypeInformation.of(Row.class)) .addSink(new SinkFunction<Tuple2<Boolean, Row>>() { @Override public void invoke(Tuple2<Boolean, Row> value, Context context) throws Exception { String sysTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()); String procTime = value.f1.toString(); System.out.println("sysTime: " + sysTime ); System.out.println("procTime: " + procTime ); System.out.println(); } }); env.execute(); } ``` ## result ``` sysTime: 2018-11-27 17:29:53.744 procTime: 2018-11-27 09:29:53.744 ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
