[teiid-issues] [JBoss JIRA] (TEIID-3937) Multiplying two columns in CASE statement overrides pushdown (Impala)

Don Krapohl (JIRA) issues at jboss.org
Wed Jan 27 15:45:00 EST 2016


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

Don Krapohl commented on TEIID-3937:
------------------------------------

Added detail.  Summary:

Impala translator

Can cast all to double and output as double and the formula pushes down.
If output is DECIMAL or BIGDECIMAL doesn't matter whether you cast or not, it doesn't send it down.
Our example has two BIGDECIMAL and one BIGINT source columns.

> Multiplying two columns in CASE statement overrides pushdown (Impala)
> ---------------------------------------------------------------------
>
>                 Key: TEIID-3937
>                 URL: https://issues.jboss.org/browse/TEIID-3937
>             Project: Teiid
>          Issue Type: Bug
>          Components: JDBC Connector
>    Affects Versions: 8.12.4
>         Environment: Ubuntu Trusty
>            Reporter: Don Krapohl
>            Assignee: Steven Hawkins
>
> In the Impala translator, pushdown doesn't happen when two columns are multiplied in the THEN portion of a CASE statement with bigdecimal data type.
> //this should push down but does not
> CASE WHEN column1  IS NOT NULL 
> THEN column1 * column2
> ELSE column3 END
> //but you can multiply the columns by a constant and it will push down
> CASE WHEN column1  IS NOT NULL 
> THEN column1 * 34567
> ELSE column3 END
> //or
> CASE WHEN column1  IS NOT NULL 
> THEN 34567 * column2
> ELSE column3 END
> //or casting to consistent datatypes with BIGDECIMAL output
> CASE WHEN column1 IS NOT NULL 
> THEN cast(column1 as BIGDECIMAL ) * cast(column2 as BIGDECIMAL )
> ELSE cast(column3 as BIGDECIMAL ) END
> //BUT output it as double with the cast statement above changed and it does push down (so floating point works)
> CASE WHEN column1 IS NOT NULL 
> THEN cast(column1 as double ) * cast(column2 as double)
> ELSE cast(column3 as double) END
> Source data types:
> Column1 is BIGDECIMAL
> Column2 is BIGINT/LONG
> Column3 is BIGDECIMAL
> Output column is BIGDECIMAL



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list