[teiid-issues] [JBoss JIRA] (TEIID-5122) Osisoft Translator - Teiid pushes cast from Boolean to Single/Double

Andrej Šmigala (JIRA) issues at jboss.org
Wed Oct 25 11:16:00 EDT 2017


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

Andrej Šmigala commented on TEIID-5122:
---------------------------------------

[~rareddy] I temporarily applied the following fix on my local install that seems to work:
{code:java}
convert.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.FLOAT, new FunctionModifier() {
    @Override
    public List<?> translate(Function function) {
        return Arrays.asList("cast(cast(",function.getParameters().get(0), " as int8) as single)"); //$NON-NLS-1$ //$NON-NLS-2$
    }
});
{code}

(and same for DOUBLE)

> Osisoft Translator - Teiid pushes cast from Boolean to Single/Double
> --------------------------------------------------------------------
>
>                 Key: TEIID-5122
>                 URL: https://issues.jboss.org/browse/TEIID-5122
>             Project: Teiid
>          Issue Type: Bug
>          Components: JDBC Connector
>    Affects Versions: 8.12.x-6.4
>            Reporter: Andrej Šmigala
>            Assignee: Ramesh Reddy
>             Fix For: 10.0
>
>
> Osisoft PI does not support conversion from Boolean to Single or Double, however, query such as 
> {code:sql}
> select cast(booleanvalue as float) from Source.smalla
> {code}
> is pushed as 
> {code:sql}
> SELECT cast(g_0.BooleanValue AS Single) AS c_0 FROM dvqe..SmallA AS g_0
> {code}
> which results in
> {noformat}
> com.osisoft.rdsa.RdsaException: [PIOLEDBENT] [SQL Analyzer] [Line 1:14] Cannot cast 'Boolean' to 'Single'.
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the teiid-issues mailing list