You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/02/17 02:51:00 UTC
[jira] [Updated] (CALCITE-5535) Time values are not properly truncated
[ https://issues.apache.org/jira/browse/CALCITE-5535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-5535:
------------------------------------
Labels: pull-request-available (was: )
> Time values are not properly truncated
> --------------------------------------
>
> Key: CALCITE-5535
> URL: https://issues.apache.org/jira/browse/CALCITE-5535
> Project: Calcite
> Issue Type: Bug
> Components: avatica
> Reporter: Will Noble
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Avatica [uses the binary modulo operator|https://github.com/apache/calcite-avatica/blob/810acf80771310431d7ef576f3404299ebb8eaf2/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L1164] to truncate time values by the number of milliseconds in a day, but this operator can result in negative numbers. We should use {{Math.floorMod()}} instead. There are also places where numbers are not truncated at all, such as when [converting to string|https://github.com/apache/calcite-avatica/blob/810acf80771310431d7ef576f3404299ebb8eaf2/core/src/main/java/org/apache/calcite/avatica/util/AbstractCursor.java#L262].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)