[JBoss JIRA] (TEIID-4601) Infinispan DSL Translator: cannot insert into byte array column
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4601?page=com.atlassian.jira.plugin... ]
Van Halbert commented on TEIID-4601:
------------------------------------
Just restate how to support byte array from the user stand point:
- The Teiid metadata will always be modeled as a byte array.
a. Define ByteString in the pojo
- .if using protobuf definition file, define protobuf attribute using bytes, resource adapter configured using protobuf
- if using pojo annotations, (TEIIDDES-3005 could be used to create pojo), resource adapter configured using pojo annotations
b. Define byte array in pojo
- resource adapter has to be configured using protobuf and custom marshaller
Changes in the translator:
- if return type/parameter type on the "get/set" method of the pojo is of ByteString, then translator will convert to/from ByteString and byte array
- if return type/parameter type on the "get/set" methods of the pojo is of byte[], then the translator will write, as is, and expect the user to have created a custom marshaller to handle serialization
> Infinispan DSL Translator: cannot insert into byte array column
> ---------------------------------------------------------------
>
> Key: TEIID-4601
> URL: https://issues.jboss.org/browse/TEIID-4601
> Project: Teiid
> Issue Type: Bug
> Components: JDG Connector
> Affects Versions: 8.12.7.6_3
> Reporter: Jan Stastny
> Assignee: Van Halbert
> Fix For: 9.2
>
>
> When a POJO class field is of type byte[] , insert into a table, which is mapped to the POJO class fails with:
> {code:plain}
> Caused by: org.teiid.translator.TranslatorException: Conversion from String to byte is not supported
> at org.teiid.translator.object.ObjectUpdateExecution.writeColumnData(ObjectUpdateExecution.java:624) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.writeColumnData(ObjectUpdateExecution.java:579) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.writeColumnData(ObjectUpdateExecution.java:572) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.handleInsert(ObjectUpdateExecution.java:208) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.executeUpdate(ObjectUpdateExecution.java:143) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.execute(ObjectUpdateExecution.java:100) ~[?:?]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:404) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:366) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_102]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_102]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_102]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at com.sun.proxy.$Proxy82.execute(Unknown Source) ~[?:?]
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_102]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_102]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_102]
> at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_102]
> Caused by: java.lang.IllegalArgumentException: Conversion from String to byte is not supported
> at org.teiid.core.util.StringUtil.valueOf(StringUtil.java:797) ~[teiid-jdbc-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.core.util.StringUtil.valueOf(StringUtil.java:768) ~[teiid-jdbc-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.translator.object.ClassRegistry.executeSetMethod(ClassRegistry.java:139) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.writeColumnData(ObjectUpdateExecution.java:608) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.writeColumnData(ObjectUpdateExecution.java:579) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.writeColumnData(ObjectUpdateExecution.java:572) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.handleInsert(ObjectUpdateExecution.java:208) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.executeUpdate(ObjectUpdateExecution.java:143) ~[?:?]
> at org.teiid.translator.object.ObjectUpdateExecution.execute(ObjectUpdateExecution.java:100) ~[?:?]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem$1.execute(ConnectorWorkItem.java:404) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:366) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_102]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_102]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_102]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at com.sun.proxy.$Proxy82.execute(Unknown Source) ~[?:?]
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_102]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) ~[teiid-engine-8.12.7.6_3-redhat-1.jar:8.12.7.6_3-redhat-1]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_102]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_102]
> at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_102]
> {code}
> POJO class:
> {code:java|title=SmallA.proto}
> package org.jboss.qe.jdg.remote.protobuf;
> message SmallA {
> required int32 intKey = 1;
> optional string stringNum = 2;
> required string stringKey = 3;
> optional float floatNum = 4;
> optional string bigIntegerValue = 5;
> optional int32 shortValue = 6;
> optional double doubleNum = 7;
> optional bytes objectValue = 8;
> optional int32 intNum = 9;
> optional string bigDecimalValue = 10;
> optional int64 longNum = 11;
> optional bool booleanValue = 12;
> optional int64 timeStampValue = 13;
> optional int32 byteNum = 14;
> optional int64 timeValue = 15;
> optional int64 dateValue = 16;
> optional int32 charValue = 17;
> }
> {code}
> Java code used to insert:
> {code:java}
> PreparedStatement pSt = con.prepareStatement(
> "INSERT INTO jdgSource1.SmallA(intKey,stringNum,stringKey,floatNum,bigIntegerValue,shortValue,doubleNum,objectValue,intNum,bigDecimalValue,longNum,booleanValue,timeStampValue,byteNum,timeValue,dateValue,charValue) VALUES"
> + "(1,'1','1',1.0,1,1,1,?,1,1.00,1,true,{ts '2016-01-01 12:00:00'},1,'12:00:00','2016-01-01','1')");
> pSt.setBytes(1, "1".getBytes());
> pSt.executeUpdate();
> {code}
> The cause is that internally the object translator uses StringUtil which can't handle byte type.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 1 month
[JBoss JIRA] (TEIID-4581) NPE occurs when the pkFieldName is not defined on the cacheTypeMap property
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4581?page=com.atlassian.jira.plugin... ]
Van Halbert updated TEIID-4581:
-------------------------------
Git Pull Request: https://github.com/teiid/teiid/pull/852
> NPE occurs when the pkFieldName is not defined on the cacheTypeMap property
> ---------------------------------------------------------------------------
>
> Key: TEIID-4581
> URL: https://issues.jboss.org/browse/TEIID-4581
> Project: Teiid
> Issue Type: Bug
> Components: JDG Connector
> Affects Versions: 9.2
> Reporter: Van Halbert
> Assignee: Van Halbert
> Fix For: 9.2
>
>
> The following NPE occurs when the pkFieldName is not defined on the cacheTypeMap property:
> 19:11:34,107 WARN [org.teiid.RUNTIME] (teiid-async-threads - 4) TEIID50036 VDB People.1 model "People" metadata failed to load. Reason:java.lang.
> NullPointerException: java.lang.NullPointerException
> at org.teiid.translator.infinispan.dsl.metadata.ProtobufMetadataProcessor.createRootTable(ProtobufMetadataProcessor.java:186)
> at org.teiid.translator.infinispan.dsl.metadata.ProtobufMetadataProcessor.process(ProtobufMetadataProcessor.java:101)
> at org.teiid.translator.infinispan.dsl.metadata.ProtobufMetadataProcessor.process(ProtobufMetadataProcessor.java:78)
> at org.teiid.translator.ExecutionFactory.getMetadata(ExecutionFactory.java:950)
> at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
> at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
> at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
> at org.teiid.jboss.VDBService$6.run(VDBService.java:395)
> at org.teiid.jboss.VDBService$7.run(VDBService.java:446)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_111]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_111]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_111]
> at org.jboss.threads.JBossThread.run(JBossThread.java:122)
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 1 month
[JBoss JIRA] (TEIID-4581) NPE occurs when the pkFieldName is not defined on the cacheTypeMap property
by Van Halbert (JIRA)
[ https://issues.jboss.org/browse/TEIID-4581?page=com.atlassian.jira.plugin... ]
Van Halbert updated TEIID-4581:
-------------------------------
Fix Version/s: 9.2
> NPE occurs when the pkFieldName is not defined on the cacheTypeMap property
> ---------------------------------------------------------------------------
>
> Key: TEIID-4581
> URL: https://issues.jboss.org/browse/TEIID-4581
> Project: Teiid
> Issue Type: Bug
> Components: JDG Connector
> Affects Versions: 9.2
> Reporter: Van Halbert
> Assignee: Van Halbert
> Fix For: 9.2
>
>
> The following NPE occurs when the pkFieldName is not defined on the cacheTypeMap property:
> 19:11:34,107 WARN [org.teiid.RUNTIME] (teiid-async-threads - 4) TEIID50036 VDB People.1 model "People" metadata failed to load. Reason:java.lang.
> NullPointerException: java.lang.NullPointerException
> at org.teiid.translator.infinispan.dsl.metadata.ProtobufMetadataProcessor.createRootTable(ProtobufMetadataProcessor.java:186)
> at org.teiid.translator.infinispan.dsl.metadata.ProtobufMetadataProcessor.process(ProtobufMetadataProcessor.java:101)
> at org.teiid.translator.infinispan.dsl.metadata.ProtobufMetadataProcessor.process(ProtobufMetadataProcessor.java:78)
> at org.teiid.translator.ExecutionFactory.getMetadata(ExecutionFactory.java:950)
> at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
> at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
> at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
> at org.teiid.jboss.VDBService$6.run(VDBService.java:395)
> at org.teiid.jboss.VDBService$7.run(VDBService.java:446)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_111]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_111]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_111]
> at org.jboss.threads.JBossThread.run(JBossThread.java:122)
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 1 month
[JBoss JIRA] (TEIID-4627) High-level event handling
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-4627?page=com.atlassian.jira.plugin... ]
Ramesh Reddy commented on TEIID-4627:
-------------------------------------
To find event is Teiid generated or foreign source, we could have some implicit variable with value available like RowsUpdated?
> High-level event handling
> -------------------------
>
> Key: TEIID-4627
> URL: https://issues.jboss.org/browse/TEIID-4627
> Project: Teiid
> Issue Type: Enhancement
> Components: Grammar, Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 9.2
>
>
> We should look into high-level plugability of event handling at a row level. This could even be handled at the language level with new trigger semantics for source tables: create trigger on tbl on cdc (insert|update...) - which could potentially even specify the topic mapping other details. There is complexity for multi-source models here though.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 1 month
[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 updated TEIID-4616:
-------------------------------
Attachment: screen-api.png
> 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
> Attachments: Screenshot-RestVDB VDB - Mozilla Firefox.png, screen-404.png, screen-api.png
>
>
> 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, 1 month
[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 updated TEIID-4616:
-------------------------------
Attachment: screen-404.png
> 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
> Attachments: Screenshot-RestVDB VDB - Mozilla Firefox.png, screen-404.png
>
>
> 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, 1 month