You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "herunkang2018 (via GitHub)" <gi...@apache.org> on 2023/10/02 00:21:53 UTC
[GitHub] [calcite-avatica] herunkang2018 commented on a diff in pull request #228: [CALCITE-5957] Date and time representation string without precede 0 is acceptable
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org