You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fh...@apache.org on 2017/10/25 20:26:55 UTC

flink git commit: [FLINK-7542] [table] Fix AggregationsITCase to not fail in certain timezones.

Repository: flink
Updated Branches:
  refs/heads/release-1.3 51e526f88 -> 0891a6f5a


[FLINK-7542] [table] Fix AggregationsITCase to not fail in certain timezones.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/0891a6f5
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/0891a6f5
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/0891a6f5

Branch: refs/heads/release-1.3
Commit: 0891a6f5accd02557e4f00c3c473db1a9a473585
Parents: 51e526f
Author: Fabian Hueske <fh...@apache.org>
Authored: Wed Oct 25 22:26:45 2017 +0200
Committer: Fabian Hueske <fh...@apache.org>
Committed: Wed Oct 25 22:26:45 2017 +0200

----------------------------------------------------------------------
 .../table/api/scala/batch/sql/AggregationsITCase.scala      | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/0891a6f5/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/AggregationsITCase.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/AggregationsITCase.scala b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/AggregationsITCase.scala
index 8368817..d755773 100644
--- a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/AggregationsITCase.scala
+++ b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/AggregationsITCase.scala
@@ -18,8 +18,7 @@
 
 package org.apache.flink.table.api.scala.batch.sql
 
-import java.sql.Timestamp
-
+import org.apache.calcite.runtime.SqlFunctions.{internalToTimestamp => toTimestamp}
 import org.apache.flink.api.scala._
 import org.apache.flink.table.api.scala.batch.utils.TableProgramsCollectionTestBase
 import org.apache.flink.table.api.scala._
@@ -312,7 +311,7 @@ class AggregationsITCase(
 
     val ds = CollectionDataSets.get3TupleDataSet(env)
       // create timestamps
-      .map(x => (x._1, x._2, x._3, new Timestamp(x._1 * 1000)))
+      .map(x => (x._1, x._2, x._3, toTimestamp(x._1 * 1000)))
     tEnv.registerDataSet("T", ds, 'a, 'b, 'c, 'ts)
 
     val result = tEnv.sql(sqlQuery).toDataSet[Row].collect()
@@ -345,7 +344,7 @@ class AggregationsITCase(
 
     val ds = CollectionDataSets.get3TupleDataSet(env)
       // create timestamps
-      .map(x => (x._1, x._2, x._3, new Timestamp(x._1 * 1000)))
+      .map(x => (x._1, x._2, x._3, toTimestamp(x._1 * 1000)))
     tEnv.registerDataSet("T", ds, 'a, 'b, 'c, 'ts)
 
     val result = tEnv.sql(sqlQuery).toDataSet[Row].collect()
@@ -380,7 +379,7 @@ class AggregationsITCase(
     val ds = CollectionDataSets.get3TupleDataSet(env)
       // create timestamps
       .filter(x => (x._2 % 2) == 0)
-      .map(x => (x._1, x._2, x._3, new Timestamp(x._1 * 1000)))
+      .map(x => (x._1, x._2, x._3, toTimestamp(x._1 * 1000)))
     tEnv.registerDataSet("T", ds, 'a, 'b, 'c, 'ts)
 
     val result = tEnv.sql(sqlQuery).toDataSet[Row].collect()