[JBoss JIRA] (TEIID-5274) Odata4 translator can't handle conditions on columns which use conversions
by Jan Martiska (JIRA)
Jan Martiska created TEIID-5274:
-----------------------------------
Summary: Odata4 translator can't handle conditions on columns which use conversions
Key: TEIID-5274
URL: https://issues.jboss.org/browse/TEIID-5274
Project: Teiid
Issue Type: Bug
Components: OData
Affects Versions: 8.12.11.6_4
Reporter: Jan Martiska
Assignee: Steven Hawkins
Failing query examples, given that {{BQT1.SmallA}} is a view backed by the OData4 translator:
- {{SELECT bigintegervalue FROM BQT1.SmallA WHERE CONVERT(bigintegervalue, INTEGER) = 1}}
-- This yields:
{noformat}
ExampleExceptionFormatter: exception message was: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 odata4: The value type class java.lang.Integer is not supported.
{noformat}
- {{SELECT stringkey FROM BQT1.SmallA WHERE CONVERT(stringkey, CHAR) = '1'}}
-- This yields:
{noformat}
ExampleExceptionFormatter: exception message was: TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 odata4: The value type class java.lang.Character is not supported.
{noformat}
Similarly if the conversion is in the DDL:
{noformat}
CREATE VIEW Simple (
charvalue char
) AS SELECT CONVERT(A.stringkey, CHAR)
FROM sourceModel.SmallA AS A;
{noformat}
Then a query like this {{SELECT Simple.CharValue FROM BQT1.Simple WHERE CharValue = '1'}} will fail with the same error.
Full stack trace:
{noformat}
07:00:13,946 WARN [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue36) Connector worker process failed for atomic-request=ZJj8bD/Hl58m.14.2.4: org.teiid.translator.TranslatorException: The value type class java.lang.Character is not supported.
at org.teiid.translator.odata4.ODataFilterVisitor.visit(ODataFilterVisitor.java:311) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.language.Literal.acceptVisitor(Literal.java:48) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataFilterVisitor.append(ODataFilterVisitor.java:325) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataFilterVisitor.appendRightComparison(ODataFilterVisitor.java:126) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataFilterVisitor.visit(ODataFilterVisitor.java:107) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.language.Comparison.acceptVisitor(Comparison.java:110) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataFilterVisitor.append(ODataFilterVisitor.java:325) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataFilterVisitor.appendFilter(ODataFilterVisitor.java:72) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataQuery.processFilter(ODataQuery.java:130) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataSelectQuery.buildURL(ODataSelectQuery.java:65) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataSQLVisitor.buildURL(ODataSQLVisitor.java:85) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataQueryExecution.execute(ODataQueryExecution.java:68) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:361)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
at com.sun.proxy.$Proxy91.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_151]
at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
Caused by: org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException: The value type class java.lang.Character is not supported.
at org.apache.olingo.commons.core.edm.primitivetype.EdmBinary.internalValueToString(EdmBinary.java:203) [odata-commons-core-4.4.0-teiid-1.jar:]
at org.apache.olingo.commons.core.edm.primitivetype.AbstractPrimitiveType.valueToString(AbstractPrimitiveType.java:86) [odata-commons-core-4.4.0-teiid-1.jar:]
at org.teiid.olingo.common.ODataTypeManager.convertToODataURIValue(ODataTypeManager.java:357) [teiid-olingo-common-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
at org.teiid.translator.odata4.ODataFilterVisitor.visit(ODataFilterVisitor.java:309) [translator-odata4-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
... 31 more
{noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (TEIID-4525) postgresql translator - remove all nulls & non printable characters
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4525?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4525:
----------------------------------
Fix Version/s: 10.2
(was: 10.x)
> postgresql translator - remove all nulls & non printable characters
> -------------------------------------------------------------------
>
> Key: TEIID-4525
> URL: https://issues.jboss.org/browse/TEIID-4525
> Project: Teiid
> Issue Type: Feature Request
> Components: JDBC Connector
> Reporter: Omar Khan
> Assignee: Steven Hawkins
> Priority: Minor
> Fix For: 10.2
>
>
> Would like to see the postgresql translator enhanced to add a feature to minimum remove nulls from text strings as some other databases i.e. Teradata allow for them where Postgres does not. This feature would behave in a similar manner as TrimSpaces, but simply remove all \u0000 characters.
> Furthermore, if possible, would like the ability to remove non printable characters to as another option provide another additional stripping mechanism, allowing the postgresql database to serve as a data cleaner if need be.
> Please refer to https://developer.jboss.org/thread/272644 for details
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (TEIID-4525) postgresql translator - remove all nulls & non printable characters
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4525?page=com.atlassian.jira.plugin... ]
Steven Hawkins reassigned TEIID-4525:
-------------------------------------
Assignee: Steven Hawkins
> postgresql translator - remove all nulls & non printable characters
> -------------------------------------------------------------------
>
> Key: TEIID-4525
> URL: https://issues.jboss.org/browse/TEIID-4525
> Project: Teiid
> Issue Type: Feature Request
> Components: JDBC Connector
> Reporter: Omar Khan
> Assignee: Steven Hawkins
> Priority: Minor
> Fix For: 10.2
>
>
> Would like to see the postgresql translator enhanced to add a feature to minimum remove nulls from text strings as some other databases i.e. Teradata allow for them where Postgres does not. This feature would behave in a similar manner as TrimSpaces, but simply remove all \u0000 characters.
> Furthermore, if possible, would like the ability to remove non printable characters to as another option provide another additional stripping mechanism, allowing the postgresql database to serve as a data cleaner if need be.
> Please refer to https://developer.jboss.org/thread/272644 for details
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (TEIID-4525) postgresql translator - remove all nulls & non printable characters
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4525?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4525.
-----------------------------------
Resolution: Done
Added the RemovePushdownCharacters execution property to the JDBC translator which is general enough to remove both null and non-printable characters.
> postgresql translator - remove all nulls & non printable characters
> -------------------------------------------------------------------
>
> Key: TEIID-4525
> URL: https://issues.jboss.org/browse/TEIID-4525
> Project: Teiid
> Issue Type: Feature Request
> Components: JDBC Connector
> Reporter: Omar Khan
> Priority: Minor
> Fix For: 10.x
>
>
> Would like to see the postgresql translator enhanced to add a feature to minimum remove nulls from text strings as some other databases i.e. Teradata allow for them where Postgres does not. This feature would behave in a similar manner as TrimSpaces, but simply remove all \u0000 characters.
> Furthermore, if possible, would like the ability to remove non printable characters to as another option provide another additional stripping mechanism, allowing the postgresql database to serve as a data cleaner if need be.
> Please refer to https://developer.jboss.org/thread/272644 for details
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (TEIID-4356) Add asort of connection test for "connection definitions" of resource adapters
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4356?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-4356.
-----------------------------------
Fix Version/s: (was: 10.x)
Resolution: Won't Fix
Since there has been no movement on this, I'm resolving as won't fix. For many scenarios the wildfly functionality to test a pool can be used. From the cli:
/subsystem=resource-adapters/resource-adapter=ldap/connection-definitions=ldapDS:test-connection-in-pool
See also https://access.redhat.com/solutions/196953
That of course does not help with delegation scenarios or those that need to test the translator and resource adapter together.
As needed let's open more specific issues if it's still unclear in the logs and potentially from the client when something isn't working.
> Add asort of connection test for "connection definitions" of resource adapters
> ------------------------------------------------------------------------------
>
> Key: TEIID-4356
> URL: https://issues.jboss.org/browse/TEIID-4356
> Project: Teiid
> Issue Type: Feature Request
> Components: Misc. Connectors
> Reporter: Marco Ardito
> Priority: Minor
>
> Could a sort of "connection test" be implemented to verify if a "connection definition" specified for a resource adapter (eg: file, google, etc) is working, and can "connect" to the resource it's supposedly pointing to?
> Data sources(jdbc) already have this kind of test, and it is quite useful to test if there's any error in their connection definition.
> With resource adapters, one must define connection definitions, but it is not possible to test them, independently from later requests/queries (eg: reading data from .csv or .xls files, or oauth web services): one has to build all the chain and really try to get data from the source, using the vdb, hoping everything is correctly defined...
> Recently I am struggling with a custom rest oauth2 RA, and I need to define
> - security domain (with client id/secret, tokens, auth uri)
> - RA using that domain
> - a connection definition for the RA accessing the remote data source
> - a VDB using the connection definition
> - a client using the VDB to try get data in sql form
> any step could be wrong, but only the last allows to check if the whole chain is working, or not.
> For any error or failure, regular users (like me) can't do anything else than double check everything... a "test connection" button, for the connection definition, would do wonders to simplify setup debug...
> Marco
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (TEIID-4745) Avoid loading the same file over again when using 'org.jboss.teiid.resource-adapter.file'
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4745?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-4745:
----------------------------------
Fix Version/s: 10.3
(was: 10.x)
> Avoid loading the same file over again when using 'org.jboss.teiid.resource-adapter.file'
> -----------------------------------------------------------------------------------------
>
> Key: TEIID-4745
> URL: https://issues.jboss.org/browse/TEIID-4745
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Environment: * WildFly 10
> * Teiid Server 9.1.2
> * CentOs 7
> Reporter: Pedro Inácio
> Assignee: Steven Hawkins
> Fix For: 10.3
>
>
> When using the file resource adapter _org.jboss.teiid.resource-adapter.file_, it should be possible that the system per se, by the means of a new property in the resource-adapter, or other option in the view definition, or other configuration elsewhere, to not to unnecessary load a file that is already loaded. Theoretically it should be possible, for example, to check the file date or the file checksum, to see if the file is already loaded by _Teiid_. If it is, then there is no need to parse the file again.
> This is important due to, specially, performance improvements. If there are a lot of files to be processed, and these files are big (200 MB or more), the system will be processing over and over again the same files if they are not updated for quite some time.
> If, for example, the user uses a Materialized View, then the view will be constantly being updated with the same data, which brings another performance penalty.
> *Note*: This could be extended to other resource-adapters with some sort of last data date for example, if the user whant to use this sort of mechanism. For example, if using a database like MySQL as source, then tthe user could define a last update table, and the system could do a check first against this table before tryng to load the data.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years