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

Tim Armstrong updated IMPALA-1880:
----------------------------------
    Priority: Trivial  (was: Minor)

> pmod() sometimes returns negative values
> ----------------------------------------
>
>                 Key: IMPALA-1880
>                 URL: https://issues.apache.org/jira/browse/IMPALA-1880
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.2
>            Reporter: John Russell
>            Priority: Trivial
>              Labels: sql-language
>
> I noticed when constructing examples to compare/contrast fmod(), pmod(), and 
> the new mod() function that pmod() sometimes returns a negative value, 
> despite its being stated to be the "positive" modulus:
> {code}
> [localhost:21000] > select pmod(5,-2);
> +-------------+
> | pmod(5, -2) |
> +-------------+
> | -1          |
> +-------------+
> {code}
> I see that's the same return value as Hive:
> {code}
> hive> select pmod(5,-2) from t1 limit 1;
> Total MapReduce jobs = 1
> ...
> OK
> -1
> Time taken: 29.269 seconds
> {code}
> This seems to be the origin of the Hive pmod() function, it isn't spec'ed out 
> in detail: https://issues.apache.org/jira/browse/HIVE-656
> I thought we should verify that our behavior is working as intended, and if 
> so let's firm up the explanation of the function a big. ("Returns the 
> positive modulus except if second argument negative", or something like that.)



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to