[JBoss JIRA] (TEIID-2605) Optimization substitutes wrong column in where clause
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2605?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-2605.
---------------------------------
> Optimization substitutes wrong column in where clause
> -----------------------------------------------------
>
> Key: TEIID-2605
> URL: https://issues.jboss.org/browse/TEIID-2605
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.1
> Environment: z/OS
> Reporter: Jeff Hayes
> Assignee: Steven Hawkins
> Attachments: query_plan.txt, views.xml
>
>
> Optimization results in a query with a different column in the WHERE clause producing an empty result set.
> Full query plan is attached but the beginning and ending queries are shown below. Note that the subject column of the IN clause is SCOPEID but optimization changes it to AUTHID for some reason.
> USER COMMAND:
> SELECT * FROM SECURITY.SCPXREF AS CHORUS_B WHERE (CHORUS_B.SYSID = 'DE29') AND ((CHORUS_B.SCOPEID IN (SELECT SN5.SCOPEID FROM SECURI
> TY.SCPNEXT AS SN5 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN4.SCOPEID FROM SECURITY.SCPNEXT AS SN4 WHERE (SYSID = 'DE29') AND
> (NEXTREC IN (SELECT SN3.SCOPEID FROM SECURITY.SCPNEXT AS SN3 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN2.SCOPEID FROM SECURI
> TY.SCPNEXT AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))))))))) OR (CHORUS_B.SCOPEID IN (SELECT SN4.SCOPEID FROM SECURIT
> Y.SCPNEXT AS SN4 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN3.SCOPEID FROM SECURITY.SCPNEXT AS SN3 WHERE (SYSID = 'DE29') AND
> (NEXTREC IN (SELECT SN2.SCOPEID FROM SECURITY.SCPNEXT AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))))))) OR (CHORUS_B.SC
> OPEID IN (SELECT SN3.SCOPEID FROM SECURITY.SCPNEXT AS SN3 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN2.SCOPEID FROM SECURITY.S
> CPNEXT AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))))) OR (CHORUS_B.SCOPEID IN (SELECT SN2.SCOPEID FROM SECURITY.SCPNEX
> T AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))) OR (CHORUS_B.SCOPEID = 'CHRDEPT1'))
> OPTIMIZATION COMPLETE:
> PROCESSOR PLAN:
> AccessNode(10) output=[x.sysid AS sysid, x.scopeid AS authid, x.authid AS scopeid, x.authtype AS authtype] SELECT g_0.SYSID, g_0.SCO
> PEID, g_0.AUTHID, g_0.AUTHTYPE FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPXREF AS g_0 WHERE (g_0.SYSID = 'DE29') AND ((g_0.AUTHID IN
> (SELECT g_1.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_1 WHERE (g_1.SYSID = 'DE29') AND (g_1.NEXTREC IN (SELECT g_2
> .SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_2 WHERE (g_2.SYSID = 'DE29') AND (g_2.NEXTREC IN (SELECT g_3.SCOPEID FR
> OM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_3 WHERE (g_3.SYSID = 'DE29') AND (g_3.NEXTREC IN (SELECT g_4.SCOPEID FROM SECURITY
> _CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_4 WHERE (g_4.SYSID = 'DE29') AND (g_4.NEXTREC = 'CHRDEPT1'))))))))) OR (g_0.AUTHID IN (SELECT
> g_5.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_5 WHERE (g_5.SYSID = 'DE29') AND (g_5.NEXTREC IN (SELECT g_6.SCOPEI
> D FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_6 WHERE (g_6.SYSID = 'DE29') AND (g_6.NEXTREC IN (SELECT g_7.SCOPEID FROM SECU
> RITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_7 WHERE (g_7.SYSID = 'DE29') AND (g_7.NEXTREC = 'CHRDEPT1'))))))) OR (g_0.AUTHID IN (SELE
> CT g_8.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_8 WHERE (g_8.SYSID = 'DE29') AND (g_8.NEXTREC IN (SELECT g_9.SCOP
> EID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_9 WHERE (g_9.SYSID = 'DE29') AND (g_9.NEXTREC = 'CHRDEPT1'))))) OR (g_0.AUTH
> ID IN (SELECT g_10.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_10 WHERE (g_10.SYSID = 'DE29') AND (g_10.NEXTREC = 'C
> HRDEPT1'))) OR (g_0.AUTHID = 'CHRDEPT1'))
> The view definitions are shown below:
> <view name="SCPNEXT">
> <columns>
> <column name="sysid" type="varchar"/>
> <column name="scopeid" type="varchar"/>
> <column name="nextrec" type="varchar"/>
> </columns>
> <definition>
> #if ($db.count("select count(*) from sys.tables where Name='config' and SchemaName = 'security_db'") > 0)
> #set ($count = 0)
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> #if ($db.count("select count(*) from sys.tables where SchemaName = 'SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}'") == 0)
> #set ($count = $count + 1)
> #end
> #end
> #if ($count == 0)
> SELECT t.sysid, t.scopeid, t.nextrec
> FROM (
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> SELECT n.sysid, n.scopeid, n.nextrec
> FROM SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}.SCPNEXT n
> #if( $velocityHasNext ) UNION #end
> #end
> ) AS t
> #end
> #end
> </definition>
> </view>
> <view name="SCPXREF">
> <columns>
> <column name="sysid" type="varchar"/>
> <column name="authid" type="varchar"/>
> <column name="scopeid" type="varchar"/>
> <column name="authtype" type="varchar"/>
> </columns>
> <definition>
> #if ($db.count("select count(*) from sys.tables where Name='config' and SchemaName = 'security_db'") > 0)
> #set ($count = 0)
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> #if ($db.count("select count(*) from sys.tables where SchemaName = 'SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}'") == 0)
> #set ($count = $count + 1)
> #end
> #end
> #if ($count == 0)
> SELECT sysid, scopeid, authid, authtype
> FROM (
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> SELECT x.sysid, x.scopeid, x.authid, x.authtype
> FROM SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}.SCPXREF x
> #if( $velocityHasNext ) UNION #end
> #end
> ) AS t
> #end
> #end
> </definition>
> </view>
> I guess the best way to test this is to define these views and run the input query with SHOWPLAN=DEBUG and see if the AUTHID substitution is occurring.
> Thanks!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
2 weeks, 6 days
[JBoss JIRA] (TEIID-3273) Exception while using biginteger column with SUM function
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3273?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3273.
-----------------------------------
Fix Version/s: 8.7.1
8.10
Resolution: Done
Corrected setting the accumulator type.
> Exception while using biginteger column with SUM function
> ---------------------------------------------------------
>
> Key: TEIID-3273
> URL: https://issues.jboss.org/browse/TEIID-3273
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7
> Environment: Teiid 8.7 and Windows
> Reporter: Rakesh Balguri
> Assignee: Steven Hawkins
> Fix For: 8.7.1, 8.10
>
>
> I have column which is of "BigInteger" type and when I am trying to execute an SQL which contains the SUM function I am getting the following exception.
> The following is the SQL:
>
> SELECT SUM(age) FROM test
>
> My understanding is that the sum of all the BigInteger's is not fitting in the size of the BigInteger and Teiid is trying to convert it into a BigDecimal and end up in an exception.
> How to fix this problem? Do we have a woraround for this?
>
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype biginteger for column 0 doesn't match the runtime type "java.math.BigDecimal". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:851) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:317) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1443) [rt.jar:1.7.0_03]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1414) [rt.jar:1.7.0_03]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) [rt.jar:1.7.0_03]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) [rt.jar:1.7.0_03]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1443) [rt.jar:1.7.0_03]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1414) [rt.jar:1.7.0_03]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) [rt.jar:1.7.0_03]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) [rt.jar:1.7.0_03]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> ... 25 more
> Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.math.BigInteger
> at org.teiid.client.BatchSerializer$BigIntegerColumnSerializer.writeObject(BatchSerializer.java:681) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:506) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:840) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> ... 36 more
> See the discussion in Teiid Forums for more information: https://developer.jboss.org/thread/251244
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 10 months
[JBoss JIRA] (TEIID-3272) JDBC Translator | Segregation of batch execution and commit mode
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3272?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3272:
---------------------------------------
I may not have followed you completely on the forum posting. The current behavior is to start a local transaction (assuming there is not a higher level transaction already) and then commit when all batches have been processed - not a commit for each batch. When are you seeing a commit with each batch? Is that from a higher level breakdown of source queries?
> The no of batches after which a commit is desired should be a configurable option.
Can you elaborate on the scenarios when you want to have a non-atomic update? What would be your expectations when there is an exception - stop processing batches, best effort continue, etc.?
> JDBC Translator | Segregation of batch execution and commit mode
> -----------------------------------------------------------------
>
> Key: TEIID-3272
> URL: https://issues.jboss.org/browse/TEIID-3272
> Project: Teiid
> Issue Type: Enhancement
> Components: JDBC Connector
> Reporter: Shiveeta Mattoo
> Assignee: Steven Hawkins
> Labels: Batch-Commit, JDBC-Transator
>
> In JDBC Translator, the batch execution and commit are coupled together. Hence, we after every batch execution, a commit is executed.
> This enhancement is for providing an ability to support the commit after a configurable 'x' no. of batches has completed, instead of an automatic commit after every batch.
> The no of batches after which a commit is desired should be a configurable option.
>
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 10 months
[JBoss JIRA] (TEIID-3273) Exception while using biginteger column with SUM function
by Rakesh Balguri (JIRA)
Rakesh Balguri created TEIID-3273:
-------------------------------------
Summary: Exception while using biginteger column with SUM function
Key: TEIID-3273
URL: https://issues.jboss.org/browse/TEIID-3273
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 8.7
Environment: Teiid 8.7 and Windows
Reporter: Rakesh Balguri
Assignee: Steven Hawkins
I have column which is of "BigInteger" type and when I am trying to execute an SQL which contains the SUM function I am getting the following exception.
The following is the SQL:
SELECT SUM(age) FROM test
My understanding is that the sum of all the BigInteger's is not fitting in the size of the BigInteger and Teiid is trying to convert it into a BigDecimal and end up in an exception.
How to fix this problem? Do we have a woraround for this?
Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype biginteger for column 0 doesn't match the runtime type "java.math.BigDecimal". Please ensure that the column's modeled datatype matches the expected data.
at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:851) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:317) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1443) [rt.jar:1.7.0_03]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1414) [rt.jar:1.7.0_03]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) [rt.jar:1.7.0_03]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) [rt.jar:1.7.0_03]
at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1443) [rt.jar:1.7.0_03]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1414) [rt.jar:1.7.0_03]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) [rt.jar:1.7.0_03]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346) [rt.jar:1.7.0_03]
at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
... 25 more
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.math.BigInteger
at org.teiid.client.BatchSerializer$BigIntegerColumnSerializer.writeObject(BatchSerializer.java:681) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:506) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:840) [teiid-client-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
... 36 more
See the discussion in Teiid Forums for more information: https://developer.jboss.org/thread/251244
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 10 months
[JBoss JIRA] (TEIID-3272) JDBC Translator | Segregation of batch execution and commit mode
by Shiveeta Mattoo (JIRA)
Shiveeta Mattoo created TEIID-3272:
--------------------------------------
Summary: JDBC Translator | Segregation of batch execution and commit mode
Key: TEIID-3272
URL: https://issues.jboss.org/browse/TEIID-3272
Project: Teiid
Issue Type: Enhancement
Components: JDBC Connector
Reporter: Shiveeta Mattoo
Assignee: Steven Hawkins
In JDBC Translator, the batch execution and commit are coupled together. Hence, we after every batch execution, a commit is executed.
This enhancement is for providing an ability to support the commit after a configurable 'x' no. of batches has completed, instead of an automatic commit after every batch.
The no of batches after which a commit is desired should be a configurable option.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 10 months
[JBoss JIRA] (TEIID-3271) JDBC Translator | Incorrect Update count reported on Batched Update Execution
by Shiveeta Mattoo (JIRA)
Shiveeta Mattoo created TEIID-3271:
--------------------------------------
Summary: JDBC Translator | Incorrect Update count reported on Batched Update Execution
Key: TEIID-3271
URL: https://issues.jboss.org/browse/TEIID-3271
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Reporter: Shiveeta Mattoo
Assignee: Steven Hawkins
Issue is related to Batched updates scenario.
Typically, the executeBatch() returns an array of integers, and each element of the array represents the update count for the respective update statement.
However in case of Teiid JDBC Translator, over and above this, we are processing the array to return a sum of all the elements as in seen in JDBCUpdateExecution -> executeTranslatedCommand method
int[] results = pstatement.executeBatch();
for (int i=0; i<results.length; i++) {
updateCount += results[i];
}
The bug is logged to fix this to meet the standard behaviour
Refer thread https://developer.jboss.org/message/914596?et=watches.email.thread#914596 for details
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 10 months
[JBoss JIRA] (TEIID-3036) Update CXF to current version (3.0.0)
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3036?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3036:
---------------------------------------
That would be with Teiid 9 in somewhere around 6 months.
> Update CXF to current version (3.0.0)
> -------------------------------------
>
> Key: TEIID-3036
> URL: https://issues.jboss.org/browse/TEIID-3036
> Project: Teiid
> Issue Type: Feature Request
> Components: Embedded
> Affects Versions: 8.8
> Reporter: Gary Gregory
>
> In the same vein as TEIID-3030, we embed CXF and Teiid in our server. We use CXF 2.7.10 and are about to update to 3.0.0. At worse, we'll go to 2.7.11 as an interim step to 3.0.0.
> Teiid embedded delivers CXF 2.6.6 for web services support.
> It would be great if we could get Teiid to the latest and greatest from CXF so we can all live in the same space without being forced to deal with any incompatibilities or class loader hacks.
> Thank you,
> Gary
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
10 years, 10 months