[JBoss JIRA] Created: (TEIID-1686) Assertion failure when using a plan result buffer
by Steven Hawkins (JIRA)
Assertion failure when using a plan result buffer
-------------------------------------------------
Key: TEIID-1686
URL: https://issues.jboss.org/browse/TEIID-1686
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 7.4
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Priority: Critical
Fix For: 7.4.1
When a plan can reuse the result buffer, for example with a top level sort operation. Then both the batchcollector and the processingnode may call close on the buffer. The second clause will trigger an assertionerror:
java.lang.AssertionError: Assertion failed.
at org.teiid.core.util.Assertion.failed(Assertion.java:73)
at org.teiid.core.util.Assertion.assertTrue(Assertion.java:68)
at org.teiid.core.util.Assertion.assertTrue(Assertion.java:60)
at org.teiid.common.buffer.TupleBuffer.saveBatch(TupleBuffer.java:177)
at org.teiid.common.buffer.TupleBuffer.close(TupleBuffer.java:192)
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:153)
at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:352)
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:278)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:49)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:207)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:194)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:118)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:288)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (TEIID-1621) Unexpected grouping for SELECT queries on views that include a GROUP BY
by Claudio Venturini (JIRA)
Unexpected grouping for SELECT queries on views that include a GROUP BY
-----------------------------------------------------------------------
Key: TEIID-1621
URL: https://issues.jboss.org/browse/TEIID-1621
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 7.4
Environment: Teiid 7.4 (with patch) deployed on JBoss AS 5.1, installed on Ubuntu Server 10.04 LTS. Four source models, two of which in MySQL 5.1.51 (on the same machine of JBoss), one on SQLServer 2000 (on another machine), and one on SQL Server 2005 (on another machine). All sources participate in XA transactions.
Reporter: Claudio Venturini
Assignee: Steven Hawkins
Attachments: server.log
I've a set of models like the one that I've already explained in https://issues.jboss.org/browse/TEIID-1562. In addition I've a physical model, named sole_rugiada_phy, which extracts data from a SQL Server 2005 database. On top of it there's a view model, named sole_rugiada_log, which transform some fields and does some joins grouping.
In particular the base table named 'vendita_referenza' is defined as follows:
{code:sql}
SELECT
SR_op.codop, CAST(SR_v.n_bolla AS VARCHAR) AS codice, SUP_ro.codref, SR_v.data, CAST(SR_v.n_prog AS INTEGER) AS n_prog, CAST(SUM(SR_v.quantita) AS INTEGER) AS quantita, SUM((((SUP_r.quantita / SUP_ro.quantita_reale) * SR_v.quantita) * SR_v.prezzo)) AS fatturato, COUNT(*) AS groupdim
FROM
((sole_rugiada_phy.MISURA124.dbo.VENDITA_REFERENZA AS SR_v INNER JOIN support_log.mediator.referenza_op AS SUP_ro ON RTRIM(LTRIM(CAST(SR_v.codref AS VARCHAR))) = SUP_ro.codice) INNER JOIN support_log.mediator.referenza AS SUP_r ON SUP_ro.codref = SUP_r.codref) INNER JOIN sole_rugiada_log.misura124.solerugiada.op AS SR_op ON SUP_ro.codop = SR_op.codop
WHERE
SR_v.data >= PARSEDATE('20090701', 'yyyyMMdd')
GROUP BY SR_op.codop, SR_v.data, SR_v.n_bolla, SR_v.n_prog, SUP_ro.codref
{code}
If I run the following query, that is a simple SELECT statement, everything works fine:
{code:sql}
SELECT
codop,
codice,
codref,
data,
n_prog,
quantita,
fatturato,
groupdim
FROM
sole_rugiada_log.misura124.solerugiada.vendita_referenza
{code}
The query above retrieves 18717 records. But if I remove some fields from the SELECT statements something goes wrong. Take for example the following query:
{code:sql}
SELECT
codop,
codref,
data,
quantita,
fatturato
FROM
sole_rugiada_log.misura124.solerugiada.vendita_referenza
{code}
The above query gets only one record, which is a grouping over all the record, even if it doesn't include a GROUP BY clause. It's not clear what type of aggregation it does. It seems to be a sum of all records, but the result is not totally exact. The value of 'fatturato' is near the real sum (5043502.561000000 instead of 5046687.249000000), but the value of 'quantita' is much different from the real sum (489566 instead of 5537638).
I noticed that removing the GROUP BY from the definition of the base table the problem disappears, but, of course, most of times this cannot be used as a workaround.
Attached there are the project of the VDB and a log of the execution of the query that produces the wrong result.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (TEIID-1653) Support Cursoring over ODBC protocol ( support UseDeclareFetch = 1)
by Ramesh Reddy (JIRA)
Support Cursoring over ODBC protocol ( support UseDeclareFetch = 1)
-------------------------------------------------------------------
Key: TEIID-1653
URL: https://issues.jboss.org/browse/TEIID-1653
Project: Teiid
Issue Type: Feature Request
Components: ODBC
Affects Versions: 7.1.1
Reporter: Ramesh Reddy
Assignee: Ramesh Reddy
Fix For: 7.4.1, 7.5, 7.1.1
Postgres ODBC driver, retrieves all the rows from server for "select" request before it passes a single row to the calling client. This requires additional memory overhead for the client applications that dealing with very large resultset, which can lead to OOM issues. Postgres ODBC driver supports a couple properties
UseDeclareFetch = 1
Fetch=1000
using which, ODBC driver will form the queries using postgres "cursor" functionality, and only fetch number of rows that are defined with variable "Fetch". This will result in faster initial response time to the user (especially UI based apps) because the driver is not fetching all rows, it is only fetching the first batch. Also, minimal memory foot print as it can clear the results as they are delivered to the client application, especially with FORWARD only cursor. Teiid will only support for FORWARD ONLY cursor.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (TEIID-1668) Exception trying to preview data or execute VDB against SYBASE BQT2 table containing clob column
by Barry LaFond (JIRA)
Exception trying to preview data or execute VDB against SYBASE BQT2 table containing clob column
------------------------------------------------------------------------------------------------
Key: TEIID-1668
URL: https://issues.jboss.org/browse/TEIID-1668
Project: Teiid
Issue Type: Bug
Reporter: Barry LaFond
Assignee: Steven Hawkins
Testing various BQT2 DB's including Sybase.
1) Imported SMALLA & SMALLB tables, added to VDB and deployed
2) Able to query SELECT IntKey FROM SMALLA and get results
2) Try to perform SELECT * FROM SMALLA and get the following
16:49:28,338 WARN [PROCESSOR] Processing exception 'BQT2_2: Unexpected exception while translating results: Error' for request rLu0N1TlGtw/.6. Exception type org.teiid.core.TeiidProcessingException thrown from org.jboss.resource.adapter.jdbc.WrappedConnection.checkException(WrappedConnection.java:873). Enable more detailed logging to see the entire stacktrace.
16:49:42,992 WARN [TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@1005083[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@b0818a handles=1 lastUse=1309988982862 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1b6e768 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@11261d3 xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@89ede txSync=null]
java.lang.UnsupportedOperationException: The method com.sybase.jdbc3.jdbc.SybCursorResultSet.getClob(int) is not supported and should not be called.
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseRuntimeException(Unknown Source)
at com.sybase.jdbc3.utils.Debug.notSupported(Unknown Source)
at com.sybase.jdbc3.jdbc.SybResultSet.getClob(Unknown Source)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.getClob(WrappedResultSet.java:503)
at org.teiid.translator.jdbc.JDBCExecutionFactory.retrieveValue(JDBCExecutionFactory.java:929)
at org.teiid.translator.jdbc.sybase.SybaseExecutionFactory.retrieveValue(SybaseExecutionFactory.java:358)
at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:103)
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:282)
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:267)
at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:338)
at org.teiid.dqp.internal.process.DataTierTupleSource.access$000(DataTierTupleSource.java:80)
at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:138)
at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:135)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:197)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:118)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
16:49:43,050 WARN [CONNECTOR] Connector worker process failed for atomic-request=A1ZwTKKSzuDt.0.1.22
[TranslatorException]Unexpected exception while translating results: Error
1 [NestedSQLException]Error
at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:110)
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:282)
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:267)
at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:338)
at org.teiid.dqp.internal.process.DataTierTupleSource.access$000(DataTierTupleSource.java:80)
at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:138)
at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:135)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:197)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:118)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:288)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.jboss.util.NestedSQLException: Error
at org.jboss.resource.adapter.jdbc.WrappedConnection.checkException(WrappedConnection.java:873)
at org.jboss.resource.adapter.jdbc.WrappedStatement.checkException(WrappedStatement.java:852)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.checkException(WrappedResultSet.java:1947)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.next(WrappedResultSet.java:1200)
at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:97)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month