docete commented on a change in pull request #10105: 
[Flink-14599][table-planner-blink] Support precision of TimestampType in blink 
planner
URL: https://github.com/apache/flink/pull/10105#discussion_r345540542
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/expressions/ArrayTypeTest.scala
 ##########
 @@ -94,6 +96,48 @@ class ArrayTypeTest extends ArrayTypeTestBase {
       "ARRAY[TIMESTAMP '1985-04-11 14:15:16', TIMESTAMP '2018-07-26 
17:18:19']",
       "[1985-04-11 14:15:16.000, 2018-07-26 17:18:19.000]")
 
+    // localDateTime use DateTimeUtils.timestampStringToUnixDate to parse a 
time string,
+    // which only support millisecond's precision.
+    testTableApi(
+      Array(
+        JLocalDateTime.of(1985, 4, 11, 14, 15, 16, 123456789),
+        JLocalDateTime.of(2018, 7, 26, 17, 18, 19, 123456789)),
+        "[1985-04-11T14:15:16.123456789, 2018-07-26T17:18:19.123456789]")
+
+    testTableApi(
+      Array(
+        JLocalDateTime.of(1985, 4, 11, 14, 15, 16, 123456700),
+        JLocalDateTime.of(2018, 7, 26, 17, 18, 19, 123456700)),
+      "[1985-04-11T14:15:16.123456700, 2018-07-26T17:18:19.123456700]")
+
+    testTableApi(
+      Array(
+        JLocalDateTime.of(1985, 4, 11, 14, 15, 16, 123456000),
+        JLocalDateTime.of(2018, 7, 26, 17, 18, 19, 123456000)),
+      "[1985-04-11T14:15:16.123456, 2018-07-26T17:18:19.123456]")
+
+    testTableApi(
+      Array(
+        JLocalDateTime.of(1985, 4, 11, 14, 15, 16, 123400000),
+        JLocalDateTime.of(2018, 7, 26, 17, 18, 19, 123400000)),
+      "[1985-04-11T14:15:16.123400, 2018-07-26T17:18:19.123400]")
+
+    testSqlApi(
+      "ARRAY[TIMESTAMP '1985-04-11 14:15:16.123456789', TIMESTAMP '2018-07-26 
17:18:19.123456789']",
+      "[1985-04-11T14:15:16.123456789, 2018-07-26T17:18:19.123456789]")
+
+    testSqlApi(
+      "ARRAY[TIMESTAMP '1985-04-11 14:15:16.1234567', TIMESTAMP '2018-07-26 
17:18:19.1234567']",
+      "[1985-04-11T14:15:16.123456700, 2018-07-26T17:18:19.123456700]")
 
 Review comment:
   The interpreted string should conforms to the definition of timestamp 
literal(SQL 2011 Part 2 Section 6.13 General Rules (11) (d)). And i will fix it 
in next commit. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to