[
https://issues.jboss.org/browse/TEIID-5168?page=com.atlassian.jira.plugin...
]
Steven Hawkins commented on TEIID-5168:
---------------------------------------
The original presto support was written for an older version which lacked a single
precision / float type. That support now exists in presto. We need to account for that
so that conversion to float pushdown is inhibited for older versions, and handled
appropriately for newer.
PrestoDB translator - Convert to float not pushed correctly
-----------------------------------------------------------
Key: TEIID-5168
URL:
https://issues.jboss.org/browse/TEIID-5168
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Running query such as
{code:sql}
SELECT StringKey, (convert(StringKey, float)+3) FROM BQT1.SmallA
{code}
Fails with the following exception:
{noformat}
org.teiid.translator.jdbc.JDBCExecutionException: 1 TEIID11008:TEIID11004 Error executing
statement(s): [SQL: SELECT g_0.stringkey AS c_0, (g_0.stringkey + 3.0) AS c_1 FROM smalla
AS g_0 LIMIT 100]
at
org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131)
[translator-jdbc-8.12.11.6_4-redhat-64-7.jar:8.12.11.6_4-redhat-64-7]
at
org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:363)
at sun.reflect.GeneratedMethodAccessor171.invoke(Unknown Source) [:1.8.0_141]
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_141]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_141]
at
org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
at com.sun.proxy.$Proxy80.execute(Unknown Source)
at
org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_141]
at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[rt.jar:1.8.0_141]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[rt.jar:1.8.0_141]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_141]
Caused by: java.sql.SQLException: Query failed (#20171121_110032_00034_8zhqn): line 1:45:
'+' cannot be applied to varchar(10), double
at
com.facebook.presto.jdbc.PrestoResultSet.resultsException(PrestoResultSet.java:1799)
at
com.facebook.presto.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:1747)
at
com.facebook.presto.jdbc.PrestoResultSet.<init>(PrestoResultSet.java:125)
at com.facebook.presto.jdbc.PrestoStatement.execute(PrestoStatement.java:212)
at
com.facebook.presto.jdbc.PrestoStatement.executeQuery(PrestoStatement.java:69)
at
org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:344)
at
org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:119)
[translator-jdbc-8.12.11.6_4-redhat-64-7.jar:8.12.11.6_4-redhat-64-7]
... 17 more
{noformat}
The query is translated as (note missing convert)
{code:sql}
SELECT g_0.stringkey AS c_0, (g_0.stringkey + 3.0) AS c_1 FROM smalla AS g_0
{code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)