herunkang2018 commented on code in PR #228:
URL: https://github.com/apache/calcite-avatica/pull/228#discussion_r1342209104
##########
core/src/test/java/org/apache/calcite/avatica/util/TimestampFromNumberAccessorTest.java:
##########
@@ -101,6 +101,24 @@ public class TimestampFromNumberAccessorTest {
value = DateTimeUtils.timestampStringToUnixDate("2014-09-30 15:28:27.356");
assertThat(instance.getString(), is("2014-09-30 15:28:27"));
+ value = DateTimeUtils.timestampStringToUnixDate("2014-2-2 15:28:27.356");
+ assertThat(instance.getString(), is("2014-02-02 15:28:27"));
+
+ value = DateTimeUtils.timestampStringToUnixDate("1945-2-2 12:2:5");
+ assertThat(instance.getString(), is("1945-02-02 12:02:05"));
+
+ value = DateTimeUtils.timestampStringToUnixDate("1945-2-2 2:2:5");
+ assertThat(instance.getString(), is("1945-02-02 02:02:05"));
+
+ value = DateTimeUtils.timestampStringToUnixDate("900-2-2 2:2:5");
+ assertThat(instance.getString(), is("0900-02-02 02:02:05"));
+
+ value = DateTimeUtils.timestampStringToUnixDate("9-2-2 2:2:5");
+ assertThat(instance.getString(), is("0009-02-02 02:02:05"));
+
+ value = DateTimeUtils.timestampStringToUnixDate("2023-01-01
22:00:00.123.123");
Review Comment:
This test case is not a regression, it is passed before and after
CALCITE-5678. We add it here for better code coverage.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]