[teiid-issues] [JBoss JIRA] (TEIID-3843) SAP HANA wrong results from MOD with float argument

Steven Hawkins (JIRA) issues at jboss.org
Wed Mar 1 14:12:00 EST 2017


    [ https://issues.jboss.org/browse/TEIID-3843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13371154#comment-13371154 ] 

Steven Hawkins commented on TEIID-3843:
---------------------------------------

[~tejones] is this something that should still be left open, or should we just remove pushdown support for mod?

> SAP HANA wrong results from MOD with float argument
> ---------------------------------------------------
>
>                 Key: TEIID-3843
>                 URL: https://issues.jboss.org/browse/TEIID-3843
>             Project: Teiid
>          Issue Type: Bug
>          Components: Misc. Connectors
>    Affects Versions: 8.7.2.6_2
>            Reporter: Jan Stastny
>            Assignee: Ted Jones
>
> SAP HANA doesn't handle correctly MOD function with float arguments. The problem occurs when the float value is less than zero.
> According to SAP HANA documentation, its MOD implementation follows the symmetric handling of MOD on less than zero values. In such case, the resulting value should be computed as:
> a is negative whole number
> n is positive whole number
> mod(a,n)
> # get -1*a
> # compute mod(-1*a,n)
> # multiply the result by -1
> # result is -1*mod(-1*a,n)
> SAP HANA follows this rule for other numeric types than float. For example for Long value -24 MOD(-24,11)=-2 , which is correct according to the MOD definition.
> But when you call MOD(-24.0,11) you get 2.0 
> In current state, the only thing Teiid could do is to prevent pushing  MOD with float arguments. It helps to cast explicitly the column to double.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the teiid-issues mailing list