You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Kazuaki Ishizaki (Jira)" <ji...@apache.org> on 2020/05/24 17:17:00 UTC

[jira] [Updated] (ARROW-8924) [C++][Gandiva] castDATE_date32() may cause overflow

     [ https://issues.apache.org/jira/browse/ARROW-8924?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kazuaki Ishizaki updated ARROW-8924:
------------------------------------
    Description: 
The following code in `cpp/src/gandiva/precompiled/time.cc` may cause overflow since `int32` * `int32` is `int32`, then it is converted to `int64`. The result of `int32` may loose the part of the result of the multiplication

 
{code:java}
gdv_date64 castDATE_date32(gdv_date32 days) { return days * MILLIS_IN_DAY; } {code}

  was:
The following code in `cpp/src/gandiva/precompiled/time.cc` may cause overflow since `int32` * `int32` is `int32`, then it is converted to `int64`.

 
{code:java}
gdv_date64 castDATE_date32(gdv_date32 days) { return days * MILLIS_IN_DAY; } {code}


> [C++][Gandiva] castDATE_date32() may cause overflow
> ---------------------------------------------------
>
>                 Key: ARROW-8924
>                 URL: https://issues.apache.org/jira/browse/ARROW-8924
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++ - Gandiva
>            Reporter: Kazuaki Ishizaki
>            Priority: Minor
>
> The following code in `cpp/src/gandiva/precompiled/time.cc` may cause overflow since `int32` * `int32` is `int32`, then it is converted to `int64`. The result of `int32` may loose the part of the result of the multiplication
>  
> {code:java}
> gdv_date64 castDATE_date32(gdv_date32 days) { return days * MILLIS_IN_DAY; } {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)