You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Anandha L Ranganathan (JIRA)" <ji...@apache.org> on 2013/10/20 22:48:42 UTC

[jira] [Commented] (HIVE-5162) Add mod(a, b) semantic for modular function

    [ https://issues.apache.org/jira/browse/HIVE-5162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13800220#comment-13800220 ] 

Anandha L Ranganathan commented on HIVE-5162:
---------------------------------------------

It seems we already have pmod function available.

select  44.22 %22,44.22%22.22,pmod(44.22,22),pmod(44.22,22.22)  from dual  limit 2;

OK
0.21999999999999886	22.0	0.21999999999999886	22.0
0.21999999999999886	22.0	0.21999999999999886	22.0
Time taken: 20.954 seconds

This will solve your requirement. Please let me know if we can close this ticket.


> Add mod(a, b) semantic for modular function
> -------------------------------------------
>
>                 Key: HIVE-5162
>                 URL: https://issues.apache.org/jira/browse/HIVE-5162
>             Project: Hive
>          Issue Type: Improvement
>          Components: UDF
>    Affects Versions: 0.11.0
>            Reporter: Xiu
>            Assignee: Anandha L Ranganathan
>            Priority: Minor
>
> Currently Hive is supporting 'a % b' as modular function, not mod(a, b). Unlike MySQL which supports both.
> It would be a good idea to support both.



--
This message was sent by Atlassian JIRA
(v6.1#6144)