[
https://issues.apache.org/jira/browse/CALCITE-1884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095142#comment-16095142
]
Julian Hyde commented on CALCITE-1884:
--------------------------------------
You keep talking about "old style". My proposal is that dateStringToUnixDate
assumes that the date is in New Style, and that unixDateToString generates a
date string in New Style. So, old style doesn't enter into it. The fact that
you continually reference old style, and Java's behavior, muddies the issue.
You ask about how to add unit tests. There are several test cases in this bug
alone. One thing to test is that dateStringToUnixDate / unixDateToString are
inverses of each other. For a wide range of dates.
It should be obvious that tests in another project are not "unit tests". The
folks from the Flink side didn't seem aware of the Gregorian shift when this
conversation started.
As you can tell, I'm pissed off because you are making it difficult for me to
review this patch. You've basically moved a few lines of code around, extremely
complex code at that. You need to prove to me that the code now does the right
thing, not place the onus on me to prove that it doesn't.
> DateTimeUtils produces incorrect results for days before Gregorian cutovers
> ---------------------------------------------------------------------------
>
> Key: CALCITE-1884
> URL: https://issues.apache.org/jira/browse/CALCITE-1884
> Project: Calcite
> Issue Type: Bug
> Components: avatica
> Affects Versions: 1.13.0
> Reporter: Haohui Mai
> Assignee: Haohui Mai
>
> dateStringToUnixDate() / unixDateToString() do not return consistent result.
> The following test fails:
> {noformat}
> @Test public void testUnixDate() {
> int days = DateTimeUtils.dateStringToUnixDate("1500-04-30");
> assertEquals("1500-04-30", DateTimeUtils.unixDateToString(days));
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)