Juraj Duráni created TEIID-4196:
-----------------------------------
Summary: Redshift - function TO_TIMESTAMP does not exist
Key: TEIID-4196
URL:
https://issues.jboss.org/browse/TEIID-4196
Project: Teiid
Issue Type: Bug
Affects Versions: 8.12.x
Reporter: Juraj Duráni
Assignee: Steven Hawkins
During the translation of query, Teiid uses _TO\_TIMESTAMP_ function, but there is no such
function in Redshift.
*Example Queries:*
SELECT IntKey, PARSETIMESTAMP(timestampvalue, 'yyyy-MM-dd HH:mm:ss') FROM
Source.SmallA
SELECT IntKey, PARSEDATE(datevalue, 'MMM-dd-yyyyGG') FROM Source.SmallA
*Exception:*
{code:plain}
12:52:37,566 WARN [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue124) TEIID30020
Processing exception for request tNdOaoYxZVoV.33 'TEIID30504 Source: 0
TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT
g_0.intkey, cast(TO_TIMESTAMP(to_char(g_0.datevalue, 'YYYY-MM-DD'),
'Mon-DD-YYYYAD') AS date) FROM smalla AS g_0]'. Originally
TeiidProcessingException 'ERROR: Specified types or functions (one per INFO message)
not supported on Redshift tables.' QueryExecutorImpl.java:2157.:
org.teiid.core.TeiidProcessingException: TEIID30504 Source: 0 TEIID11008:TEIID11004 Error
executing statement(s): [Prepared Values: [] SQL: SELECT g_0.intkey,
cast(TO_TIMESTAMP(to_char(g_0.datevalue, 'YYYY-MM-DD'), 'Mon-DD-YYYYAD')
AS date) FROM smalla AS g_0]
at
org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:401)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at
org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:161)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:391)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:470)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[rt.jar:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
Caused by: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error
executing statement(s): [Prepared Values: [] SQL: SELECT g_0.intkey,
cast(TO_TIMESTAMP(to_char(g_0.datevalue, 'YYYY-MM-DD'), 'Mon-DD-YYYYAD')
AS date) FROM smalla AS g_0]
at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131)
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:364)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) [:1.8.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_40]
at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_40]
at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at com.sun.proxy.$Proxy47.execute(Unknown Source)
at
org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_40]
at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
[teiid-engine-8.12.5.redhat-4.jar:8.12.5.redhat-4]
... 6 more
Caused by: org.postgresql.util.PSQLException: ERROR: Specified types or functions (one per
INFO message) not supported on Redshift tables.
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
at
org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123)
... 17 more
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)