[JBoss JIRA] (TEIID-4617) Olap translator: Mondrian ClassNotFoundException moving from v 3.5.0 to 3.12.0
by Jan Stastny (JIRA)
Jan Stastny created TEIID-4617:
----------------------------------
Summary: Olap translator: Mondrian ClassNotFoundException moving from v 3.5.0 to 3.12.0
Key: TEIID-4617
URL: https://issues.jboss.org/browse/TEIID-4617
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 8.12.7.6_3
Reporter: Jan Stastny
Assignee: Steven Hawkins
Attachments: Screenshot from 2016-12-05 07-49-16.png
Change of version of Mondrian from 3.5.0 to 3.12.0 causes class not found exception.
{code:plain}
07:44:03,800 WARN [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue10) Connector worker process failed for atomic-request=NFuIrbxSPuIu.0.3.3: org.teiid.translator.TranslatorException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/mondrianDS
at org.teiid.translator.olap.OlapExecutionFactory.getConnection(OlapExecutionFactory.java:87) [translator-olap-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
at org.teiid.translator.olap.OlapExecutionFactory.getConnection(OlapExecutionFactory.java:45) [translator-olap-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
at org.teiid.translator.ExecutionFactory.getConnection(ExecutionFactory.java:202) [teiid-api-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:330)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_102]
at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
at com.sun.proxy.$Proxy81.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_102]
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_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_102]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_102]
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/mondrianDS
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:151)
at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:69)
at org.teiid.translator.olap.OlapExecutionFactory.getConnection(OlapExecutionFactory.java:85) [translator-olap-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
... 20 more
Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/mondrianDS
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:410)
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:367)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:499)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:143)
... 22 more
Caused by: javax.resource.ResourceException: IJ000658: Unexpected throwable while trying to create a connection: null
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:454)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:457)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:429)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:344)
... 25 more
Caused by: javax.resource.ResourceException: Could not create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:351)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:299)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:858)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:413)
... 28 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: mondrian.spi.impl.JndiDataSourceResolver from [Module "org.jboss.teiid.translator.olap:main" from local module loader @16f65612 (finder: local module finder @311d617d (roots: /home/jstastny/tmp-workspaces/workspace/modules,/home/jstastny/tmp-workspaces/workspace/modules/system/layers/dv,/home/jstastny/tmp-workspaces/workspace/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.4.9.CP,/home/jstastny/tmp-workspaces/workspace/modules/system/layers/base))]
at mondrian.util.ClassResolver$AbstractClassResolver.instantiateSafe(ClassResolver.java:84)
at mondrian.rolap.RolapConnection.getDataSourceResolver(RolapConnection.java:471)
at mondrian.rolap.RolapConnection.createDataSource(RolapConnection.java:427)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:135)
at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:91)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:113)
at mondrian.olap.DriverManager.getConnection(DriverManager.java:69)
at mondrian.olap4j.MondrianOlap4jConnection.<init>(MondrianOlap4jConnection.java:162)
at mondrian.olap4j.FactoryJdbc4Plus$AbstractConnection.<init>(FactoryJdbc4Plus.java:323)
at mondrian.olap4j.FactoryJdbc41Impl$MondrianOlap4jConnectionJdbc41.<init>(FactoryJdbc41Impl.java:118)
at mondrian.olap4j.FactoryJdbc41Impl.newConnection(FactoryJdbc41Impl.java:32)
at mondrian.olap4j.MondrianOlap4jDriver.connect(MondrianOlap4jDriver.java:97)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:323)
... 31 more
Caused by: java.lang.ClassNotFoundException: mondrian.spi.impl.JndiDataSourceResolver from [Module "org.jboss.teiid.translator.olap:main" from local module loader @16f65612 (finder: local module finder @311d617d (roots: /home/jstastny/tmp-workspaces/workspace/modules,/home/jstastny/tmp-workspaces/workspace/modules/system/layers/dv,/home/jstastny/tmp-workspaces/workspace/modules/system/layers/base/.overlays/layer-base-jboss-eap-6.4.9.CP,/home/jstastny/tmp-workspaces/workspace/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.7.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.7.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.7.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.7.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.7.Final-redhat-1]
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_102]
at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_102]
at mondrian.util.ClassResolver$AbstractClassResolver.forName(ClassResolver.java:92)
at mondrian.util.ClassResolver$AbstractClassResolver.instantiateSafe(ClassResolver.java:63)
... 43 more
{code}
But the class is present in the new version of Mondrian too, see attached screenshot with decompiled jar structure.
One workaround I found was to add dependency into olap translator's module.xml pointing at the org.mondrian module, which contains the mondrian jar.
But this action is not required when using Mondrian 3.5.0.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4441) Add FTP/SFTP based access to the File Resource Adapter
by Kylin Soong (JIRA)
[ https://issues.jboss.org/browse/TEIID-4441?page=com.atlassian.jira.plugin... ]
Kylin Soong edited comment on TEIID-4441 at 12/5/16 1:39 AM:
-------------------------------------------------------------
[1] is a good guide for VFS 3 including examples. [2] is an example I have written to demonstrate how to mount remote ftp server file system path to VFS, and execute get and delete.
I support to add VFS as a abstract layer, deprecate the current FileConnection, create a new FileConnection use the VirtualFile replace the File.
Also VFS support mount zip achieves, and load classpath file, we may load data from a jar or classpath if we use VFS.
[1] https://developer.jboss.org/wiki/VFS3UserGuide
[2] https://developer.jboss.org/wiki/ExtendingJBossVFSMountFtpFileSystem
was (Author: kylin):
[1] is a good guide for VFS 3 including examples. [2] is an example I have written to demonstrate how to mount remote ftp server file system path to VFS, and execute get and delete.
I support to add VFS as a abstract layer, deprecate the current FileConnection, create a new FileConnection use the VirtualFile replace the File.
Also VFS support zip achieves, we may load data from a jar if we use VFS.
[1] https://developer.jboss.org/wiki/VFS3UserGuide
[2] https://developer.jboss.org/wiki/ExtendingJBossVFSMountFtpFileSystem
> Add FTP/SFTP based access to the File Resource Adapter
> ------------------------------------------------------
>
> Key: TEIID-4441
> URL: https://issues.jboss.org/browse/TEIID-4441
> Project: Teiid
> Issue Type: Enhancement
> Components: Misc. Connectors
> Reporter: Ramesh Reddy
> Assignee: Kylin Soong
> Fix For: Open To Community, 9.2
>
>
> This has been requested few times in the community, it would be nice to give provide this functionality. Using http://commons.apache.org/proper/commons-net/ seems to be right decision.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4616) api-docs on Swagger UI error
by Kylin Soong (JIRA)
[ https://issues.jboss.org/browse/TEIID-4616?page=com.atlassian.jira.plugin... ]
Kylin Soong commented on TEIID-4616:
------------------------------------
I use teiid 8.12.x test, but can't reproduce it, how did you get this error?
AFAIK, http://127.0.0.1:8080/RestVDB/api will go into Swagger UI page, I have seen you use the http://127.0.0.1:8080/RestVDB/api-docs, did you try to access the Swagger UI page?
> api-docs on Swagger UI error
> ----------------------------
>
> Key: TEIID-4616
> URL: https://issues.jboss.org/browse/TEIID-4616
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 8.12.6.6_3
> Reporter: Debbie Steigner
> Assignee: Kylin Soong
>
> The link on the Swagger UI for api-docs, shows Error - {"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://127.0.0.1:8080/RestVDB/api-docs/Debbiev"}]}
> But I can enter the URL and go to the api-doc - http://127.0.0.1:8080/RestVDB/api-docs/Debbiev
> {"apiVersion":"2.0.0","swaggerVersion":"1.2","basePath":"/RestVDB","resourcePath":"/Debbiev","apis":[{"path":"/Debbiev/mytable","operations":[{"method":"POST","summary":"(XML) postmytable: null","notes":"","type":"java.io.InputStream","nickname":"postmytable","produces":["application/xml; charset=UTF-8"],"consumes":["application/xml"],"parameters":[{"name":"body","required":false,"type":"java.io.InputStream","paramType":"body","allowMultiple":false}]},{"method":"GET","summary":"(XML) getmytable: null","notes":"","type":"java.io.InputStream","nickname":"getmytable","produces":["application/xml; charset=UTF-8"],"parameters":[]}]},{"path":"/Debbiev/json/mytable","operations":[{"method":"GET","summary":"(JSON) getmytable: null","notes":"","type":"string","nickname":"getmytablejson","produces":["application/json; charset=UTF-8"],"parameters":[]},{"method":"POST","summary":"(JSON) postmytable: null","notes":"","type":"string","nickname":"postmytablejson","produces":["application/json; charset=UTF-8"],"consumes":["application/json"],"parameters":[{"name":"body","required":false,"type":"java.io.InputStream","paramType":"body","allowMultiple":false}]}]}]}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4610) Impala regexp_replace function colliding with prepared values
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4610?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-4610:
---------------------------------------
As far as I can see this is an issue with the Cloudera driver, similar to https://issues.cloudera.org/browse/IMPALA-2609
I think the resolution here would be to turn of the use of bind variables on the translator.
> Impala regexp_replace function colliding with prepared values
> -------------------------------------------------------------
>
> Key: TEIID-4610
> URL: https://issues.jboss.org/browse/TEIID-4610
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.13.3
> Reporter: Scott Wallace
> Assignee: Steven Hawkins
> Attachments: server.log
>
>
> Impala regexp_replace function appears to collide with prepared values only when attemping to replace apostrophe.
> select impala.regexp_replace(string_column,char(39),concat('&apos',char(59)))
> from some_impala_table
> where date_key = concat(substring('2016-01-15',1,7),'-01')
> and customer_id = 112
> Error:
> {noformat}
> org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote org.teiid.core.TeiidProcessingException: TEIID30504 warehouse: 500051 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: ['2016-01-01'] SQL: SELECT regexp_replace(g_0.`string_column`, '\'', ''') FROM some_impala_table g_0 WHERE g_0.`process_date_key` = ? AND g_0.`customer_id` = 112]
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4609) Sap-hana translator - unsupported cast to data type bintext
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4609?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4609:
----------------------------------
Component/s: Misc. Connectors
[~tejones] is this something you can take a look at?
> Sap-hana translator - unsupported cast to data type bintext
> -----------------------------------------------------------
>
> Key: TEIID-4609
> URL: https://issues.jboss.org/browse/TEIID-4609
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.5
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
>
> In some cases, Teiid uses for pushing queries to Sap-Hanadata type bintext. More precisely, uses cast(... as bintext). However, this type is supported only in column tables not in row tables. Moreover, cast to bintext seems to be unsupported by Sap-Hana - see \[1\] and [doc|https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/db6dd4751910...]
> {code:plain|title=\[1\] Server log}
> 16:02:36,318 DEBUG [org.teiid.TRANSPORT] (New I/O worker #1) processing message:MessageHolder: key=819 contents=Invoke interface org.teiid.client.security.ILogon.ping
> 16:02:36,318 DEBUG [org.teiid.TRANSPORT] (New I/O worker #1) send message: MessageHolder: key=819 contents=null
> 16:02:36,319 DEBUG [org.teiid.TRANSPORT] (New I/O worker #1) processing message:MessageHolder: key=820 contents=Invoke interface org.teiid.client.security.ILogon.ping
> 16:02:36,319 DEBUG [org.teiid.SECURITY] (New I/O worker #1) Keep-alive ping received for session: wmQvWWaxavzo
> 16:02:36,319 DEBUG [org.teiid.TRANSPORT] (New I/O worker #1) send message: MessageHolder: key=820 contents=null
> 16:02:36,435 DEBUG [org.teiid.TRANSPORT] (New I/O worker #3) processing message:MessageHolder: key=821 contents=Invoke interface org.teiid.client.DQP.executeRequest
> 16:02:36,436 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue103) Request Thread wmQvWWaxavzo.18 with state NEW
> 16:02:36,437 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue103) wmQvWWaxavzo.18 Command has no cache hint and result set cache mode is not on.
> 16:02:36,437 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue103) wmQvWWaxavzo.18 executing select * from crud.smalla
> 16:02:36,439 DEBUG [org.teiid.PLANNER] (Worker12_QueryProcessorQueue103) [LOW [Relational Planner] limit not supported by source Source - limit node not pushed TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=100, OUTPUT_COLS=null}, LOW [Relational Planner] limit not supported by source Source - limit node not pushed TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=100, OUTPUT_COLS=[IntKey, StringKey, IntNum, StringNum, FloatNum, LongNum, DoubleNum, convert(ByteNum, byte), DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue, convert(BigIntegerValue, biginteger), BigDecimalValue, convert(ObjectValue, object)]}]
> 16:02:36,439 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue103) ProcessTree for wmQvWWaxavzo.18 LimitNode(0) output=[IntKey, StringKey, IntNum, StringNum, FloatNum, LongNum, DoubleNum, convert(ByteNum, byte), DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue, convert(BigIntegerValue, biginteger), BigDecimalValue, convert(ObjectValue, object)] limit 100
> AccessNode(1) output=[IntKey, StringKey, IntNum, StringNum, FloatNum, LongNum, DoubleNum, convert(ByteNum, byte), DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue, convert(BigIntegerValue, biginteger), BigDecimalValue, convert(ObjectValue, object)] SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, convert(g_0.ByteNum, byte), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, convert(g_0.BigIntegerValue, biginteger), g_0.BigDecimalValue, convert(g_0.ObjectValue, object) FROM Source.smalla AS g_0
> 16:02:36,439 DEBUG [org.teiid.TXN_LOG] (Worker12_QueryProcessorQueue103) before getOrCreateTransactionContext:org.teiid.dqp.internal.process.TransactionServerImpl@1cc9d855(wmQvWWaxavzo)
> 16:02:36,440 DEBUG [org.teiid.TXN_LOG] (Worker12_QueryProcessorQueue103) after getOrCreateTransactionContext : wmQvWWaxavzo NONE ID:NONE
> 16:02:36,440 DEBUG [org.teiid.BUFFER_MGR] (Worker12_QueryProcessorQueue103) Creating TupleBuffer: 39 [CRUD.SmallA.IntKey, CRUD.SmallA.StringKey, CRUD.SmallA.IntNum, CRUD.SmallA.StringNum, CRUD.SmallA.FloatNum, CRUD.SmallA.LongNum, CRUD.SmallA.DoubleNum, CRUD.SmallA.ByteNum, CRUD.SmallA.DateValue, CRUD.SmallA.TimeValue, CRUD.SmallA.TimestampValue, CRUD.SmallA.BooleanValue, CRUD.SmallA.CharValue, CRUD.SmallA.ShortValue, CRUD.SmallA.BigIntegerValue, CRUD.SmallA.BigDecimalValue, CRUD.SmallA.ObjectValue] [class java.lang.Integer, class java.lang.String, class java.lang.Integer, class java.lang.String, class java.lang.Float, class java.lang.Long, class java.lang.Double, class java.lang.Byte, class java.sql.Date, class java.sql.Time, class java.sql.Timestamp, class java.lang.Boolean, class java.lang.Character, class java.lang.Short, class java.math.BigInteger, class java.math.BigDecimal, class java.lang.Object] batch size 256 of type PROCESSOR
> 16:02:36,440 DEBUG [org.teiid.CONNECTOR] (Worker12_QueryProcessorQueue103) wmQvWWaxavzo.18.1.24 Create State
> 16:02:36,440 DEBUG [org.teiid.BUFFER_MGR] (Worker12_QueryProcessorQueue103) wmQvWWaxavzo.18.1.24 Blocking on source query wmQvWWaxavzo.18.1.24
> 16:02:36,441 DEBUG [org.teiid.BUFFER_MGR] (Worker12_QueryProcessorQueue103) wmQvWWaxavzo.18 Blocking on source request(s).
> 16:02:36,441 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue103) Request Thread wmQvWWaxavzo.18 - processor blocked
> 16:02:36,441 DEBUG [org.teiid.PROCESSOR] (Worker13_QueryProcessorQueue104) Running task for parent thread Worker12_QueryProcessorQueue103
> 16:02:36,441 DEBUG [org.teiid.CONNECTOR] (Worker13_QueryProcessorQueue104) wmQvWWaxavzo.18.1.24 Processing NEW request: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, convert(g_0.ByteNum, byte), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, convert(g_0.BigIntegerValue, biginteger), g_0.BigDecimalValue, convert(g_0.ObjectValue, object) FROM Source.smalla AS g_0
> 16:02:36,444 DEBUG [org.teiid.CONNECTOR] (Worker13_QueryProcessorQueue104) wmQvWWaxavzo.18.1.24 Obtained execution
> 16:02:36,444 DEBUG [org.teiid.CONNECTOR] (Worker13_QueryProcessorQueue104) Source-specific command: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, cast(g_0.ByteNum AS tinyint), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, cast(g_0.BigIntegerValue AS bigint), g_0.BigDecimalValue, cast(g_0.ObjectValue AS bintext) FROM NULL_NULL_CRUDsmalla AS g_0
> 16:02:36,922 WARN [org.teiid.CONNECTOR] (Worker13_QueryProcessorQueue104) Connector worker process failed for atomic-request=wmQvWWaxavzo.18.1.24: org.teiid.translator.jdbc.JDBCExecutionException: 257 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, cast(g_0.ByteNum AS tinyint), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, cast(g_0.BigIntegerValue AS bigint), g_0.BigDecimalValue, cast(g_0.ObjectValue AS bintext) FROM NULL_NULL_CRUDsmalla AS g_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:364)
> at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source) [:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy48.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-internal]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> 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-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "bintext": line 1 col 315 (at pos 315)
> at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:345)
> at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:185)
> at com.sap.db.jdbc.packet.ReplyPacket.buildExceptionChain(ReplyPacket.java:100)
> at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:1130)
> at com.sap.db.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1810)
> at com.sap.db.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:981)
> at com.sap.db.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:183)
> at com.sap.db.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:142)
> at com.sap.db.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:87)
> at com.sap.db.jdbc.CallableStatementSapDBFinalize.<init>(CallableStatementSapDBFinalize.java:31)
> at com.sap.db.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:1379)
> at com.sap.db.jdbc.trace.Connection.prepareStatement(Connection.java:347)
> at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:744)
> at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:730)
> at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:405)
> at org.teiid.translator.jdbc.JDBCBaseExecution.getPreparedStatement(JDBCBaseExecution.java:196) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:121) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> ... 17 more
> 16:02:36,926 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue105) Request Thread wmQvWWaxavzo.18 with state PROCESSING
> 16:02:36,926 DEBUG [org.teiid.CONNECTOR] (Worker12_QueryProcessorQueue105) wmQvWWaxavzo.18.1.24 Remove State
> 16:02:36,926 DEBUG [org.teiid.CONNECTOR] (Worker12_QueryProcessorQueue105) wmQvWWaxavzo.18.1.24 Processing Close : SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, convert(g_0.ByteNum, byte), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, convert(g_0.BigIntegerValue, biginteger), g_0.BigDecimalValue, convert(g_0.ObjectValue, object) FROM Source.smalla AS g_0
> 16:02:36,926 DEBUG [org.teiid.CONNECTOR] (Worker12_QueryProcessorQueue105) wmQvWWaxavzo.18.1.24 Closed execution
> 16:02:36,926 DEBUG [org.teiid.CONNECTOR] (Worker12_QueryProcessorQueue105) wmQvWWaxavzo.18.1.24 Closed connection
> 16:02:36,927 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue105) QueryProcessor: closing processor
> 16:02:36,927 WARN [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue105) TEIID30020 Processing exception for request wmQvWWaxavzo.18 'TEIID30504 Source: 257 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, cast(g_0.ByteNum AS tinyint), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, cast(g_0.BigIntegerValue AS bigint), g_0.BigDecimalValue, cast(g_0.ObjectValue AS bintext) FROM NULL_NULL_CRUDsmalla AS g_0]'. Originally TeiidProcessingException 'SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "bintext": line 1 col 315 (at pos 315)' SQLExceptionSapDB.java:345.: org.teiid.core.TeiidProcessingException: TEIID30504 Source: 257 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, cast(g_0.ByteNum AS tinyint), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, cast(g_0.BigIntegerValue AS bigint), g_0.BigDecimalValue, cast(g_0.ObjectValue AS bintext) FROM NULL_NULL_CRUDsmalla AS g_0]
> at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:401) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:161) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:391) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.LimitNode.nextBatchDirect(LimitNode.java:102) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> Caused by: org.teiid.translator.jdbc.JDBCExecutionException: 257 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, cast(g_0.ByteNum AS tinyint), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, cast(g_0.BigIntegerValue AS bigint), g_0.BigDecimalValue, cast(g_0.ObjectValue AS bintext) FROM NULL_NULL_CRUDsmalla 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-8.jar:8.12.5.redhat-8]
> at sun.reflect.GeneratedMethodAccessor95.invoke(Unknown Source) [:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at com.sun.proxy.$Proxy48.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> ... 6 more
> Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "bintext": line 1 col 315 (at pos 315)
> at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:345)
> at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:185)
> at com.sap.db.jdbc.packet.ReplyPacket.buildExceptionChain(ReplyPacket.java:100)
> at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:1130)
> at com.sap.db.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1810)
> at com.sap.db.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:981)
> at com.sap.db.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:183)
> at com.sap.db.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:142)
> at com.sap.db.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:87)
> at com.sap.db.jdbc.CallableStatementSapDBFinalize.<init>(CallableStatementSapDBFinalize.java:31)
> at com.sap.db.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:1379)
> at com.sap.db.jdbc.trace.Connection.prepareStatement(Connection.java:347)
> at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:744)
> at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:730)
> at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:405)
> at org.teiid.translator.jdbc.JDBCBaseExecution.getPreparedStatement(JDBCBaseExecution.java:196)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:121)
> ... 17 more
> 16:02:36,930 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue105) Removing tuplesource for the request wmQvWWaxavzo.18
> 16:02:36,930 DEBUG [org.teiid.BUFFER_MGR] (Worker12_QueryProcessorQueue105) Removing TupleBuffer: 39
> 16:02:36,930 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue105) wmQvWWaxavzo.18 Finished Processing
> 16:02:36,930 DEBUG [org.teiid.PROCESSOR] (Worker12_QueryProcessorQueue105) org.teiid.core.TeiidProcessingException: TEIID30504 Source: 257 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0.IntKey, g_0.StringKey, g_0.IntNum, g_0.StringNum, g_0.FloatNum, g_0.LongNum, g_0.DoubleNum, cast(g_0.ByteNum AS tinyint), g_0.DateValue, g_0.TimeValue, g_0.TimestampValue, g_0.BooleanValue, g_0.CharValue, g_0.ShortValue, cast(g_0.BigIntegerValue AS bigint), g_0.BigDecimalValue, cast(g_0.ObjectValue AS bintext) FROM NULL_NULL_CRUDsmalla AS g_0] Sending error to client wmQvWWaxavzo.18
> 16:02:36,930 DEBUG [org.teiid.TRANSPORT] (Worker12_QueryProcessorQueue105) send message: MessageHolder: key=821 contents=ResultsMessage rowCount=0 finalRow=-1
> {code}
> {code:sql|title=sap-hana create table command - column or row}
> create (column) table NULL_NULL_CRUDSmallA (IntKey integer not null, StringNum varchar(255), CharValue varchar(1), ObjectValue blob, DoubleNum double, BigIntegerValue numeric(19,2), ShortValue smallint, FloatNum float(19), IntNum integer, BigDecimalValue numeric(19,2), LongNum bigint, BooleanValue boolean, TimestampValue timestamp, ByteNum smallint, StringKey varchar(255), TimeValue time, DateValue date, primary key (IntKey))
> {code}
> {code:sql|title=DDL metadata}
> CREATE FOREIGN TABLE smalla (IntKey integer PRIMARY KEY,
> StringKey string,
> IntNum integer,
> StringNum string,
> FloatNum float,
> LongNum bigint,
> DoubleNum double,
> ByteNum smallint,
> DateValue date,
> TimeValue time,
> TimestampValue timestamp,
> BooleanValue boolean,
> CharValue char(1),
> ShortValue smallint,
> BigIntegerValue decimal,
> BigDecimalValue decimal,
> ObjectValue varbinary)
> OPTIONS (UPDATABLE 'TRUE', ...);
> CREATE VIEW SmallA (IntKey integer PRIMARY KEY,
> StringKey string,
> IntNum integer,
> StringNum string,
> FloatNum float,
> LongNum long,
> DoubleNum double,
> ByteNum byte,
> DateValue date,
> TimeValue time,
> TimestampValue timestamp,
> BooleanValue boolean,
> CharValue char,
> ShortValue short,
> BigIntegerValue biginteger,
> BigDecimalValue bigdecimal,
> ObjectValue object)
> OPTIONS (UPDATABLE 'TRUE')
> AS
> SELECT IntKey, StringKey, IntNum,
> StringNum, FloatNum, LongNum, DoubleNum,
> convert(ByteNum, byte) AS ByteNum, DateValue, TimeValue, TimestampValue,
> BooleanValue, CharValue, ShortValue,
> convert(BigIntegerValue, biginteger) AS BigIntegerValue, BigDecimalValue,
> convert(ObjectValue, object) AS ObjectValue
> FROM Source.smalla;
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4608) Insert statement - multi-value insert into view - incorrect type resolution if first tuple contains NULL
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4608?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4608.
-----------------------------------
Resolution: Done
Changed the logic to just update the mapping prior to replacement to map to the view columns rather than replacing by value.
> Insert statement - multi-value insert into view - incorrect type resolution if first tuple contains NULL
> --------------------------------------------------------------------------------------------------------
>
> Key: TEIID-4608
> URL: https://issues.jboss.org/browse/TEIID-4608
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.5
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 9.2, 9.0.6, 9.1.2
>
>
> If first tuple of multi-value insert contains NULL value (regular statement, not prepared statement), Teiid is not able to resolve types properly.
> *Example 1:*
> IntKey - primary key, type integer
> IntNum - regular column, type integer
> {code:sql}
> INSERT INTO tablea (IntKey, IntNum) VALUES (1, null), (2, 2);
> {code}
> This query ends with ClassCastException:
> {code:plain}
> 14:24:39,133 ERROR [org.teiid.CONNECTOR] (Worker8_QueryProcessorQueue105) Connector worker process failed for atomic-request=8V7FTKxvQ5zY.14.0.34: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Float
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:957) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.sybase.BaseSybaseExecutionFactory.bindValue(BaseSybaseExecutionFactory.java:147) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:243) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:402)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:364)
> at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) [:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy48.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:142)
> at org.teiid.query.processor.relational.ProjectIntoNode.checkExitConditions(ProjectIntoNode.java:257)
> at org.teiid.query.processor.relational.ProjectIntoNode.nextBatchDirect(ProjectIntoNode.java:228)
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282)
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145)
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> 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-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> 14:24:39,136 ERROR [org.teiid.PROCESSOR] (Worker8_QueryProcessorQueue105) TEIID30019 Unexpected exception for request 8V7FTKxvQ5zY.14: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Float
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:957)
> at org.teiid.translator.jdbc.sybase.BaseSybaseExecutionFactory.bindValue(BaseSybaseExecutionFactory.java:147)
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107)
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:243)
> at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:402) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:364) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) [:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at com.sun.proxy.$Proxy48.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:142) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.ProjectIntoNode.checkExitConditions(ProjectIntoNode.java:257) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.ProjectIntoNode.nextBatchDirect(ProjectIntoNode.java:228) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> {code}
> If I switch tuples, no exception occurs and insert finishes successfully.
> {code:sql}
> INSERT INTO tablea (IntKey, IntNum) VALUES (2, 2), (1, null);
> {code}
> *Example 2*
> IntKey - primary key, type integer
> CharValue - regular column, type char
> {code:sql}
> INSERT INTO tablea (IntKey, CharValue) VALUES (1, null), (2, convert('+', char));
> {code}
> This query ends with TEIID30328 Unable to evaluate convert(X.expr2, short):...
> {code:plain}
> 14:41:35,053 WARN [org.teiid.PROCESSOR] (Worker14_QueryProcessorQueue136) TEIID30020 Processing exception for request 8V7FTKxvQ5zY.30 'TEIID30328 Unable to evaluate convert(X.expr2, short): TEIID30384 Error while evaluating function convert'. Originally ExpressionEvaluationException 'TEIID10076 Invalid conversion from type class java.lang.Character with value '+' to type class java.lang.Short' DataTypeManager.java:940. Enable more detailed logging to see the entire stacktrace.
> {code}
> Again, switching tuples resolves the issue.
> {code:sql}
> INSERT INTO tablea (IntKey, CharValue) VALUES (2, convert('+', char)), (1, null);
> {code}
> This occurs only in case of view with defined _trigger instead of insert_. Here is my VDB for MSSQL, but I can see same behavior for MySql and PostgreSQL
> {code:xml}
> <metadata type="DDL">
> CREATE FOREIGN TABLE SmallA (IntKey integer PRIMARY KEY,
> StringKey string,
> IntNum integer,
> StringNum string,
> FloatNum float,
> LongNum bigint,
> DoubleNum double,
> ByteNum smallint,
> DateValue date,
> TimeValue time,
> TimestampValue timestamp,
> BooleanValue boolean,
> CharValue char(1),
> ShortValue smallint,
> BigIntegerValue decimal,
> BigDecimalValue decimal,
> ObjectValue blob)
> OPTIONS (UPDATABLE 'TRUE');
> </metadata>
> ...
> <metadata type="DDL"><
> CREATE VIEW SmallA (IntKey integer PRIMARY KEY,
> StringKey string,
> IntNum integer,
> StringNum string,
> FloatNum float,
> LongNum long,
> DoubleNum double,
> ByteNum byte,
> DateValue date,
> TimeValue time,
> TimestampValue timestamp,
> BooleanValue boolean,
> CharValue char,
> ShortValue short,
> BigIntegerValue biginteger,
> BigDecimalValue bigdecimal,
> ObjectValue object)
> OPTIONS (UPDATABLE 'TRUE')
> AS
> SELECT IntKey, StringKey, IntNum,
> StringNum, FloatNum, LongNum, DoubleNum,
> convert(ByteNum, byte) AS ByteNum, DateValue, TimeValue, TimestampValue,
> BooleanValue, CharValue, ShortValue,
> convert(BigIntegerValue, biginteger) AS BigIntegerValue, BigDecimalValue,
> convert(ObjectValue, object) AS ObjectValue
> FROM Source.SmallA;
> CREATE TRIGGER ON SmallA INSTEAD OF INSERT AS FOR EACH ROW
> BEGIN ATOMIC
> INSERT INTO Source.smalla (IntKey, StringKey, IntNum, StringNum, FloatNum, LongNum, DoubleNum, ByteNum, DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue, BigIntegerValue, BigDecimalValue, ObjectValue) VALUES
> (NEW.IntKey, NEW.StringKey, NEW.IntNum, NEW.StringNum, NEW.FloatNum, NEW.LongNum, NEW.DoubleNum, NEW.ByteNum, NEW.DateValue, NEW.TimeValue, NEW.TimestampValue,
> NEW.BooleanValue, NEW.CharValue, NEW.ShortValue, NEW.BigIntegerValue, NEW.BigDecimalValue, to_bytes(convert(NEW.ObjectValue, string), 'UTF-8'));
> END;
> </metadata>
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4526) Integrate with Debezium for CDC for maintaining materialized views
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-4526?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-4526:
-------------------------------------
I am trying to work/undestand from [~shawkins] comments from above
- Thanks to [~kylin] looks like, based on 'refreshmatviewRows' procedure he already implemented the predicated based approach.
- He also consolidated the loading and refreshing to same procedures calls for internal and external materialization.
- I am not concerned about source not being transactional, as majority of sources Teiid uses for this feature are. The exception that really matters is JDG (although it is claimed to be transactional). We just need to document/recommend as such.
- Lazy invalidation based on additional column needs a separate ticket. Not sure I understand the full benefits of this yet.
- Also the consolidation of Status table management needs a separate ticket. This should be fairly narrow task.
The second bullet is where the meat required for this JIRA IMO. We agree we need event handling. I first thought was to support event handling on views where they share the common primary key with the source table. Although that simple case, and PK might not match one on one with View's PK. This goes into comment about "manual" strategy where the predicate is anything into some what of "defined" predicate. We can design this to be pluggable or some kind rule based.
[~shawkins] I do not think I understand the trigger semantics on source, can you explain further? I understand semantics, but I am failing to see responsibility? Are you saying these define a generic way to generate a event in the Teiid system, which could have originated from Debezium or otherwise. The actions you take in those triggers procedures can be update of the materialization table?
> Integrate with Debezium for CDC for maintaining materialized views
> ------------------------------------------------------------------
>
> Key: TEIID-4526
> URL: https://issues.jboss.org/browse/TEIID-4526
> Project: Teiid
> Issue Type: Feature Request
> Components: Server
> Affects Versions: 9.2
> Reporter: Van Halbert
> Assignee: Steven Hawkins
> Priority: Critical
>
> Integrate with Debezium so that Teiid will be able to consume and react to the row-level change events and do something interesting with them, such as update the materialized view(s).
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years
[JBoss JIRA] (TEIID-4608) Insert statement - multi-value insert into view - incorrect type resolution if first tuple contains NULL
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4608?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4608:
----------------------------------
Component/s: Query Engine
Fix Version/s: 9.2
9.0.6
9.1.2
Priority: Blocker (was: Major)
There is an issue in the trigger action planning logic that causing the null value in the first projection to be mapped to all null values (including columns that are not changing). This causes values to be misaligned in subsequent projections. Also upping the priority since this could insert inappropriate data.
> Insert statement - multi-value insert into view - incorrect type resolution if first tuple contains NULL
> --------------------------------------------------------------------------------------------------------
>
> Key: TEIID-4608
> URL: https://issues.jboss.org/browse/TEIID-4608
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.12.5
> Reporter: Juraj Duráni
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 9.2, 9.0.6, 9.1.2
>
>
> If first tuple of multi-value insert contains NULL value (regular statement, not prepared statement), Teiid is not able to resolve types properly.
> *Example 1:*
> IntKey - primary key, type integer
> IntNum - regular column, type integer
> {code:sql}
> INSERT INTO tablea (IntKey, IntNum) VALUES (1, null), (2, 2);
> {code}
> This query ends with ClassCastException:
> {code:plain}
> 14:24:39,133 ERROR [org.teiid.CONNECTOR] (Worker8_QueryProcessorQueue105) Connector worker process failed for atomic-request=8V7FTKxvQ5zY.14.0.34: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Float
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:957) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.sybase.BaseSybaseExecutionFactory.bindValue(BaseSybaseExecutionFactory.java:147) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:243) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84) [translator-jdbc-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:402)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:364)
> at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) [:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy48.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:142)
> at org.teiid.query.processor.relational.ProjectIntoNode.checkExitConditions(ProjectIntoNode.java:257)
> at org.teiid.query.processor.relational.ProjectIntoNode.nextBatchDirect(ProjectIntoNode.java:228)
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282)
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145)
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472)
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348)
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
> 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-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> 14:24:39,136 ERROR [org.teiid.PROCESSOR] (Worker8_QueryProcessorQueue105) TEIID30019 Unexpected exception for request 8V7FTKxvQ5zY.14: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Float
> at org.teiid.translator.jdbc.JDBCExecutionFactory.bindValue(JDBCExecutionFactory.java:957)
> at org.teiid.translator.jdbc.sybase.BaseSybaseExecutionFactory.bindValue(BaseSybaseExecutionFactory.java:147)
> at org.teiid.translator.jdbc.JDBCBaseExecution.bind(JDBCBaseExecution.java:107)
> at org.teiid.translator.jdbc.JDBCUpdateExecution.executeTranslatedCommand(JDBCUpdateExecution.java:243)
> at org.teiid.translator.jdbc.JDBCUpdateExecution.execute(JDBCUpdateExecution.java:84)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:402) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:364) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) [:1.8.0-internal]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0-internal]
> at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0-internal]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at com.sun.proxy.$Proxy48.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:142) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.ProjectIntoNode.checkExitConditions(ProjectIntoNode.java:257) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.ProjectIntoNode.nextBatchDirect(ProjectIntoNode.java:228) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0-internal]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0-internal]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
> {code}
> If I switch tuples, no exception occurs and insert finishes successfully.
> {code:sql}
> INSERT INTO tablea (IntKey, IntNum) VALUES (2, 2), (1, null);
> {code}
> *Example 2*
> IntKey - primary key, type integer
> CharValue - regular column, type char
> {code:sql}
> INSERT INTO tablea (IntKey, CharValue) VALUES (1, null), (2, convert('+', char));
> {code}
> This query ends with TEIID30328 Unable to evaluate convert(X.expr2, short):...
> {code:plain}
> 14:41:35,053 WARN [org.teiid.PROCESSOR] (Worker14_QueryProcessorQueue136) TEIID30020 Processing exception for request 8V7FTKxvQ5zY.30 'TEIID30328 Unable to evaluate convert(X.expr2, short): TEIID30384 Error while evaluating function convert'. Originally ExpressionEvaluationException 'TEIID10076 Invalid conversion from type class java.lang.Character with value '+' to type class java.lang.Short' DataTypeManager.java:940. Enable more detailed logging to see the entire stacktrace.
> {code}
> Again, switching tuples resolves the issue.
> {code:sql}
> INSERT INTO tablea (IntKey, CharValue) VALUES (2, convert('+', char)), (1, null);
> {code}
> This occurs only in case of view with defined _trigger instead of insert_. Here is my VDB for MSSQL, but I can see same behavior for MySql and PostgreSQL
> {code:xml}
> <metadata type="DDL">
> CREATE FOREIGN TABLE SmallA (IntKey integer PRIMARY KEY,
> StringKey string,
> IntNum integer,
> StringNum string,
> FloatNum float,
> LongNum bigint,
> DoubleNum double,
> ByteNum smallint,
> DateValue date,
> TimeValue time,
> TimestampValue timestamp,
> BooleanValue boolean,
> CharValue char(1),
> ShortValue smallint,
> BigIntegerValue decimal,
> BigDecimalValue decimal,
> ObjectValue blob)
> OPTIONS (UPDATABLE 'TRUE');
> </metadata>
> ...
> <metadata type="DDL"><
> CREATE VIEW SmallA (IntKey integer PRIMARY KEY,
> StringKey string,
> IntNum integer,
> StringNum string,
> FloatNum float,
> LongNum long,
> DoubleNum double,
> ByteNum byte,
> DateValue date,
> TimeValue time,
> TimestampValue timestamp,
> BooleanValue boolean,
> CharValue char,
> ShortValue short,
> BigIntegerValue biginteger,
> BigDecimalValue bigdecimal,
> ObjectValue object)
> OPTIONS (UPDATABLE 'TRUE')
> AS
> SELECT IntKey, StringKey, IntNum,
> StringNum, FloatNum, LongNum, DoubleNum,
> convert(ByteNum, byte) AS ByteNum, DateValue, TimeValue, TimestampValue,
> BooleanValue, CharValue, ShortValue,
> convert(BigIntegerValue, biginteger) AS BigIntegerValue, BigDecimalValue,
> convert(ObjectValue, object) AS ObjectValue
> FROM Source.SmallA;
> CREATE TRIGGER ON SmallA INSTEAD OF INSERT AS FOR EACH ROW
> BEGIN ATOMIC
> INSERT INTO Source.smalla (IntKey, StringKey, IntNum, StringNum, FloatNum, LongNum, DoubleNum, ByteNum, DateValue, TimeValue, TimestampValue, BooleanValue, CharValue, ShortValue, BigIntegerValue, BigDecimalValue, ObjectValue) VALUES
> (NEW.IntKey, NEW.StringKey, NEW.IntNum, NEW.StringNum, NEW.FloatNum, NEW.LongNum, NEW.DoubleNum, NEW.ByteNum, NEW.DateValue, NEW.TimeValue, NEW.TimestampValue,
> NEW.BooleanValue, NEW.CharValue, NEW.ShortValue, NEW.BigIntegerValue, NEW.BigDecimalValue, to_bytes(convert(NEW.ObjectValue, string), 'UTF-8'));
> END;
> </metadata>
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years