KurtYoung 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_r344433283
##########
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:
why the result isn't `1985-04-11T14:15:16.1234567`?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services