]
Work on TEIID-5030 started by Steven Hawkins.
---------------------------------------------
Couchbase error in date/timestamp/time datatype pushdown
--------------------------------------------------------
Key: TEIID-5030
URL:
https://issues.jboss.org/browse/TEIID-5030
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.12.x-6.4
Reporter: Jan Stastny
Assignee: Steven Hawkins
Priority: Critical
There is an issue with date, time and timestamp datatype pushdown. The following example
is for date. For timestamp the behaviour is the same, only exception message complains
about 'ts' or 't' instead of 'd'.
{code:sql|title=query}
SELECT BQT1.SmallA.DateValue FROM BQT1.SmallA WHERE BQT1.SmallA.DateValue =
'2000-02-02'
{code}
{code:title=teiid-command.log}
09:59:44,422 INFO [org.teiid.COMMAND_LOG] (New I/O worker #2) QE2ZpDa/Btt5 START
USER COMMAND: startTime=2017-08-24 09:59:44.422 requestID=QE2ZpDa/Btt5.31
txID=null sessionID=QE2ZpDa/Btt5 applicationName=JDBC
principal=user@teiid-security vdbName=couchbase vdbVersion=1 sql=SELECT
BQT1.SmallA.DateValue FROM BQT1.SmallA WHERE BQT1.SmallA.DateValue = '2000-02-02'
09:59:44,436 DEBUG [org.teiid.COMMAND_LOG] (Worker9_QueryProcessorQueue68) QE2ZpDa/Btt5
START DATA SRC COMMAND: startTime=2017-08-24 09:59:44.436
requestID=QE2ZpDa/Btt5.31 sourceCommandID=0 executionID=12 txID=null
modelName=Couchbase_small translatorName=couchbase sessionID=QE2ZpDa/Btt5
principal=user@teiid-security sql=SELECT convert(Couchbase_small.SmallA.DateValue, date)
FROM Couchbase_small.SmallA WHERE convert(Couchbase_small.SmallA.DateValue, date) =
{d'2000-02-02'}
09:59:44,436 DEBUG [org.teiid.COMMAND_LOG] (Worker9_QueryProcessorQueue68) QE2ZpDa/Btt5
SOURCE SRC COMMAND: endTime=2017-08-24 09:59:44.436 requestID=QE2ZpDa/Btt5.31
sourceCommandID=0 executionID=12 txID=null modelName=Couchbase_small
translatorName=couchbase sessionID=QE2ZpDa/Btt5 principal=user@teiid-security
sourceCommand=[SELECT TOATOM(`$cb_c1_DateValue`) FROM `dvqe_small` `$cb_t1` LET
`$cb_c1_DateValue` = `$cb_t1`.`DateValue` WHERE TOATOM(`$cb_c1_DateValue`) = {d
'2000-02-02'} AND `$cb_t1`.`type` = 'SmallA']
09:59:44,588 DEBUG [org.teiid.COMMAND_LOG] (Worker9_QueryProcessorQueue68) QE2ZpDa/Btt5
ERROR SRC COMMAND: endTime=2017-08-24 09:59:44.588 requestID=QE2ZpDa/Btt5.31
sourceCommandID=0 executionID=12 txID=null modelName=Couchbase_small
translatorName=couchbase sessionID=QE2ZpDa/Btt5 principal=user@teiid-security
09:59:44,596 DEBUG [org.teiid.COMMAND_LOG] (Worker8_QueryProcessorQueue69) QE2ZpDa/Btt5
END SRC COMMAND: endTime=2017-08-24 09:59:44.596 requestID=QE2ZpDa/Btt5.31
sourceCommandID=0 executionID=12 txID=null modelName=Couchbase_small
translatorName=couchbase sessionID=QE2ZpDa/Btt5 principal=user@teiid-security
finalRowCount=0 cpuTime(ns)=8526015
09:59:44,596 INFO [org.teiid.COMMAND_LOG] (Worker8_QueryProcessorQueue69) QE2ZpDa/Btt5
ERROR USER COMMAND: endTime=2017-08-24 09:59:44.596 requestID=QE2ZpDa/Btt5.31
txID=null sessionID=QE2ZpDa/Btt5 principal=user@teiid-security vdbName=couchbase
vdbVersion=1 finalRowCount=null
09:59:44,598 INFO [org.teiid.COMMAND_LOG] (Worker8_QueryProcessorQueue69) QE2ZpDa/Btt5
END USER COMMAND: endTime=2017-08-24 09:59:44.598 requestID=QE2ZpDa/Btt5.31
txID=null sessionID=QE2ZpDa/Btt5 principal=user@teiid-security vdbName=couchbase
vdbVersion=1 finalRowCount=0
{code}
{code:title=server.log}
09:59:44,588 WARN [org.teiid.CONNECTOR] (Worker9_QueryProcessorQueue68) Connector worker
process failed for atomic-request=QE2ZpDa/Btt5.31.0.12:
org.teiid.translator.TranslatorException: Query did not complete successfully:
[{"msg":"syntax error - at d","code":3000}], error code:
fatal
at
org.teiid.translator.couchbase.CouchbaseQueryExecution.execute(CouchbaseQueryExecution.java:73)
[translator-couchbase-8.12.11.6_4-redhat-64-5.jar:8.12.11.6_4-redhat-64-5]
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:363)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[rt.jar:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_121]
at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
at com.sun.proxy.$Proxy79.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_121]
at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
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:1142)
[rt.jar:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_121]
Caused by: javax.resource.ResourceException: Query did not complete successfully:
[{"msg":"syntax error - at d","code":3000}], error code:
fatal
at
org.teiid.resource.adapter.couchbase.CouchbaseConnectionImpl.execute(CouchbaseConnectionImpl.java:64)
at
org.teiid.translator.couchbase.CouchbaseQueryExecution.execute(CouchbaseQueryExecution.java:71)
[translator-couchbase-8.12.11.6_4-redhat-64-5.jar:8.12.11.6_4-redhat-64-5]
... 18 more
09:59:44,596 WARN [org.teiid.PROCESSOR] (Worker8_QueryProcessorQueue69) TEIID30020
Processing exception for request QE2ZpDa/Btt5.31 'TEIID30504 couchbase_small: Query
did not complete successfully: [{"msg":"syntax error - at
d","code":3000}], error code: fatal'. Originally
TeiidProcessingException CouchbaseConnectionImpl.java:64. Enable more detailed logging to
see the entire stacktrace.
{code}