[
https://issues.apache.org/jira/browse/CALCITE-4476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17270771#comment-17270771
]
Julian Hyde commented on CALCITE-4476:
--------------------------------------
The line {{second = 1;}} should be {{second = 0;}}. The mistake was by me, in
[f19143bbf2|https://github.com/apache/calcite/commit/f19143bbf2]. I think I
copy-pasted the logic to convert to dates (months and days are 1-based) to
create the logic to convert to times (hours, minutes, seconds are 0-based). And
the error escaped notice because I tested "00:00:00" but not "00:00".
> DateTimeUtils.timeStringToUnixDate may produce wrong time
> ---------------------------------------------------------
>
> Key: CALCITE-4476
> URL: https://issues.apache.org/jira/browse/CALCITE-4476
> Project: Calcite
> Issue Type: Bug
> Components: avatica
> Affects Versions: avatica-1.17.0
> Reporter: Vladimir Ozerov
> Assignee: Vladimir Ozerov
> Priority: Major
> Fix For: avatica-1.18.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The query {{SELECT CAST("00:00" as TIME)}} returns {{00:00:01}} in Calcite.
> The problem is located in the {{DateTimeUtils.timeStringToUnixDate}} method
> that mistakenly assigns {{1}} to seconds and minutes in some cases.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)