[JBoss JIRA] (TEIID-5046) DuplicateRecordException when adding some tables with dots in columns
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5046?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5046:
----------------------------------
Priority: Major (was: Blocker)
> Maybe it's worth to introduce some kind of indexes in column names if there is already a column with the same name instead of throwing out DuplicateRecordException. Or maybe there is an another solution.
I'm open to an auto-resolution mechanism, but I'd like that to be optional not default behavior so that it is clear there are name conflicts.
> DuplicateRecordException when adding some tables with dots in columns
> ---------------------------------------------------------------------
>
> Key: TEIID-5046
> URL: https://issues.jboss.org/browse/TEIID-5046
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector, Query Engine
> Affects Versions: 9.3.1
> Environment: teiid-9.3.1 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Fix For: 10.0
>
>
> when adding such table:
> {code:sql}
> create table t1 (
> "a.b" int,
> "a_b" int
> );
> {code}
> we will get the following stacktrace:
> {noformat}
> 2017-08-31 15:21:34,121 WARN [org.teiid.RUNTIME] (Worker1_async-teiid-threads1) TEIID50036 VDB test.1 model "test_pg" metadata failed to load. Reason:TEIID60016 Duplicate Column te
> st_pg.t1.a_b: org.teiid.metadata.DuplicateRecordException: TEIID60016 Duplicate Column test_pg.t1.a_b
> at org.teiid.metadata.MetadataFactory.addColumn(MetadataFactory.java:198)
> at org.teiid.translator.jdbc.JDBCMetdataProcessor.addColumn(JDBCMetdataProcessor.java:449)
> at org.teiid.translator.jdbc.JDBCMetdataProcessor.processColumns(JDBCMetdataProcessor.java:410)
> at org.teiid.translator.jdbc.JDBCMetdataProcessor.getColumns(JDBCMetdataProcessor.java:385)
> at org.teiid.translator.jdbc.JDBCMetdataProcessor.getTables(JDBCMetdataProcessor.java:336)
> at org.teiid.translator.jdbc.JDBCMetdataProcessor.getConnectorMetadata(JDBCMetdataProcessor.java:166)
> at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:306)
> at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:69)
> at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
> at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
> at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
> at org.teiid.jboss.VDBService$6.run(VDBService.java:341)
> at org.teiid.jboss.VDBService$7.run(VDBService.java:392)
> 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:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
> I suppose the problem related to auto replacement of dots on underscores which was fixed in TEIID-4913 issue. Maybe it's worth to introduce some kind of indexes in column names if there is already a column with the same name instead of throwing out DuplicateRecordException. Or maybe there is an another solution.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 6 months
[JBoss JIRA] (TEIID-5030) Couchbase error in date/timestamp/time datatype pushdown
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5030?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5030.
-----------------------------------
Fix Version/s: 10.0
8.12.x-6.4
9.3.3
Resolution: Done
Updated the supportsConvert method to prevent the unintended pushdown of unsupported conversions.
> 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
> Fix For: 10.0, 8.12.x-6.4, 9.3.3
>
>
> 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}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 6 months
[JBoss JIRA] (TEIID-5033) Couchbase substring function is 0-based
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5033?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5033:
---------------------------------------
This issue was resolved by also reverting the rewriter behavior with negative indexes for substring. Since it is already documented to support indexing from the end of the string, that is the expected behavior. The pg translator was updated to match this as well.
> Couchbase substring function is 0-based
> ---------------------------------------
>
> Key: TEIID-5033
> URL: https://issues.jboss.org/browse/TEIID-5033
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.x-6.4
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
>
> There is difference in SUBSTRING function handling in Teiid and Couchbase.
> Teiid handling:
> {code:sql|title=query1}
> SELECT SUBSTRING('49',1)
> {code}
> || expr1 ||
> || 49 ||
> Couchbase pushdown:
> {code:sql|title=query2}
> SELECT SUBSTRING(IntKey,1) FROM BQT1.SmallA WHERE IntKey=49
> {code}
> || expr1 ||
> || 9 ||
> {code:title=teiid-command.log}
> 16:04:32,385 INFO [org.teiid.COMMAND_LOG] (New I/O worker #2) QE2ZpDa/Btt5 START USER COMMAND: startTime=2017-08-24 16:04:32.385 requestID=QE2ZpDa/Btt5.116 txID=null sessionID=QE2ZpDa/Btt5 applicationName=JDBC principal=user@teiid-security vdbName=couchbase vdbVersion=1 sql=SELECT SUBSTRING(IntKey,1) FROM BQT1.SmallA WHERE IntKey=49
> 16:04:32,390 DEBUG [org.teiid.COMMAND_LOG] (Worker35_QueryProcessorQueue325) QE2ZpDa/Btt5 START DATA SRC COMMAND: startTime=2017-08-24 16:04:32.39 requestID=QE2ZpDa/Btt5.116 sourceCommandID=0 executionID=79 txID=null modelName=Couchbase_small translatorName=couchbase sessionID=QE2ZpDa/Btt5 principal=user@teiid-security sql=SELECT SUBSTRING(convert(Couchbase_small.SmallA.IntKey, string), 1) FROM Couchbase_small.SmallA WHERE Couchbase_small.SmallA.IntKey = 49
> 16:04:32,391 DEBUG [org.teiid.COMMAND_LOG] (Worker35_QueryProcessorQueue325) QE2ZpDa/Btt5 SOURCE SRC COMMAND: endTime=2017-08-24 16:04:32.391 requestID=QE2ZpDa/Btt5.116 sourceCommandID=0 executionID=79 txID=null modelName=Couchbase_small translatorName=couchbase sessionID=QE2ZpDa/Btt5 principal=user@teiid-security sourceCommand=[SELECT SUBSTR(TOSTRING(`$cb_c1_IntKey`), 1) FROM `dvqe_small` `$cb_t1` LET `$cb_c1_IntKey` = `$cb_t1`.`IntKey` WHERE `$cb_c1_IntKey` = 49 AND `$cb_t1`.`type` = 'SmallA']
> 16:04:32,607 DEBUG [org.teiid.COMMAND_LOG] (Worker34_QueryProcessorQueue326) QE2ZpDa/Btt5 END SRC COMMAND: endTime=2017-08-24 16:04:32.607 requestID=QE2ZpDa/Btt5.116 sourceCommandID=0 executionID=79 txID=null modelName=Couchbase_small translatorName=couchbase sessionID=QE2ZpDa/Btt5 principal=user@teiid-security finalRowCount=1 cpuTime(ns)=1689816
> 16:04:32,610 INFO [org.teiid.COMMAND_LOG] (Worker34_QueryProcessorQueue327) QE2ZpDa/Btt5 END USER COMMAND: endTime=2017-08-24 16:04:32.61 requestID=QE2ZpDa/Btt5.116 txID=null sessionID=QE2ZpDa/Btt5 principal=user@teiid-security vdbName=couchbase vdbVersion=1 finalRowCount=1
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 6 months
[JBoss JIRA] (TEIID-5046) DuplicateRecordException when adding some tables with dots in columns
by dalex dalex (JIRA)
dalex dalex created TEIID-5046:
----------------------------------
Summary: DuplicateRecordException when adding some tables with dots in columns
Key: TEIID-5046
URL: https://issues.jboss.org/browse/TEIID-5046
Project: Teiid
Issue Type: Bug
Components: JDBC Connector, Query Engine
Affects Versions: 9.3.1
Environment: teiid-9.3.1 on WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final)
Reporter: dalex dalex
Assignee: Steven Hawkins
Priority: Blocker
when adding such table:
{code:sql}
create table t1 (
"a.b" int,
"a_b" int
);
{code}
we will get the following stacktrace:
{noformat}
2017-08-31 15:21:34,121 WARN [org.teiid.RUNTIME] (Worker1_async-teiid-threads1) TEIID50036 VDB test.1 model "test_pg" metadata failed to load. Reason:TEIID60016 Duplicate Column te
st_pg.t1.a_b: org.teiid.metadata.DuplicateRecordException: TEIID60016 Duplicate Column test_pg.t1.a_b
at org.teiid.metadata.MetadataFactory.addColumn(MetadataFactory.java:198)
at org.teiid.translator.jdbc.JDBCMetdataProcessor.addColumn(JDBCMetdataProcessor.java:449)
at org.teiid.translator.jdbc.JDBCMetdataProcessor.processColumns(JDBCMetdataProcessor.java:410)
at org.teiid.translator.jdbc.JDBCMetdataProcessor.getColumns(JDBCMetdataProcessor.java:385)
at org.teiid.translator.jdbc.JDBCMetdataProcessor.getTables(JDBCMetdataProcessor.java:336)
at org.teiid.translator.jdbc.JDBCMetdataProcessor.getConnectorMetadata(JDBCMetdataProcessor.java:166)
at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:306)
at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecutionFactory.java:69)
at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
at org.teiid.jboss.VDBService$6.run(VDBService.java:341)
at org.teiid.jboss.VDBService$7.run(VDBService.java:392)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{noformat}
I suppose the problem related to auto replacement of dots on underscores which was fixed in TEIID-4913 issue. Maybe it's worth to introduce some kind of indexes in column names if there is already a column with the same name instead of throwing out DuplicateRecordException. Or maybe there is an another solution.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 6 months
[JBoss JIRA] (TEIID-5045) Rewriter allows "true" criteria to be modified
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-5045?page=com.atlassian.jira.plugin... ]
Van Halbert commented on TEIID-5045:
------------------------------------
The 2 test I ran were:
select not(true)
select * from Accounts where 1=1
and the both were working according to what he was after.
> Rewriter allows "true" criteria to be modified
> ----------------------------------------------
>
> Key: TEIID-5045
> URL: https://issues.jboss.org/browse/TEIID-5045
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 9.0, 8.12.5, 8.13.4
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 10.0, 9.2.6, 9.3.3
>
>
> If a query containing the predicate not(true) is issued, the logic in the query rewriter will modify the definition of the "true" predicate, which will corrupt subsequent queries.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
7 years, 6 months