You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Sergey Soldatov (JIRA)" <ji...@apache.org> on 2018/01/10 21:08:00 UTC

[jira] [Updated] (PHOENIX-4525) Integer overflow in GroupBy execution

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

Sergey Soldatov updated PHOENIX-4525:
-------------------------------------
    Attachment: PHOENIX-4525.patch

A simple fix, forcing to use longs during the calculation.

> Integer overflow in GroupBy execution
> -------------------------------------
>
>                 Key: PHOENIX-4525
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4525
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.13.0
>            Reporter: Sergey Soldatov
>            Assignee: Sergey Soldatov
>         Attachments: PHOENIX-4525.patch
>
>
> During the execution of group by we adjust memory for the internal cache to keep all unique keys. We're increasing the number of keys by 1.5 factor and calculate how much space we need for it using SizedUtil.sizeOfMap, which is using ints as parameters and returns long. But since we are using all ints during the calculation, the integer overflow may happen and the method would return a negative value. As the result the query would fail, reporting that unable to allocate cache with negative size. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)