[JBoss JIRA] (TEIID-4461) Salesforce translator - foreign tables does not support query statements by default
by Juraj Duráni (JIRA)
Juraj Duráni created TEIID-4461:
-----------------------------------
Summary: Salesforce translator - foreign tables does not support query statements by default
Key: TEIID-4461
URL: https://issues.jboss.org/browse/TEIID-4461
Project: Teiid
Issue Type: Bug
Reporter: Juraj Duráni
Assignee: Steven Hawkins
If salesforce objects are modeled in VDB using DDL metadata (CREATE FOREIGN TABLE...), user cannot select data from them by default. See VDB \[1\], RA definition \[2\] and exception \[3\].
*SELECT * FROM sfSourceProp.Pricebook2* -> OK
*SELECT * FROM sfSourceNative.Pricebook2* -> OK
*SELECT * FROM sfSource.Pricebook2* ->fail \[3\]
{code:xml|title=\[1\] VDB}
<vdb name="salesforce-test" version="1">
<model name="sfSourceNative" type="PHYSICAL">
<source name="sfnative" translator-name="salesforce-34" connection-jndi-name="java:/salesforce"/>
<metadata type="NATIVE"/>
</model>
<model name="sfSource" type="PHYSICAL">
<source name="sf" translator-name="salesforce-34" connection-jndi-name="java:/salesforce"/>
<metadata type="DDL"><![CDATA[CREATE FOREIGN TABLE Pricebook2 (Id string, Name string, IsActive boolean, IsStandard boolean, Description string, IsDeleted boolean) OPTIONS (UPDATABLE 'TRUE');]]>
</metadata>
</model>
<model name="sfSourceProp" type="PHYSICAL">
<source name="sfprop" translator-name="salesforce-34" connection-jndi-name="java:/salesforce"/>
<metadata type="DDL"><![CDATA[CREATE FOREIGN TABLE Pricebook2 (Id string, Name string, IsActive boolean, IsStandard boolean, Description string, IsDeleted boolean) OPTIONS (UPDATABLE 'TRUE', "{http://www.teiid.org/translator/salesforce/2012}Supports Query" 'TRUE');]]>
</metadata>
</model>
</vdb>
{code}
{code:xml|title=\[2\] Resource adapter}
<resource-adapter id="salesforce-ds">
<module slot="main" id="org.jboss.teiid.resource-adapter.salesforce-34"/>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="org.teiid.resource.adapter.salesforce.SalesForceManagedConnectionFactory" jndi-name="java:/salesforce" enabled="true" use-java-context="true" pool-name="salesforce-ds">
<config-property name="password">
secretplustoken
</config-property>
<config-property name="URL">
https://www.salesforce.com/services/Soap/u/34.0
</config-property>
<config-property name="username">
user(a)example.com
</config-property>
</connection-definition>
</connection-definitions>
</resource-adapter>
{code}
{code:plain|title=\[3\] Exception}
12:33:22,178 WARN [org.teiid.PROCESSOR] (Worker6_QueryProcessorQueue85) TEIID30020 Processing exception for request EmUpFy4HxjNz.0 'TEIID30504 sf: Pricebook2 does not support the query statement.'. Originally TeiidProcessingException SelectVisitor.java:129.: org.teiid.core.TeiidProcessingException: TEIID30504 sf: Pricebook2 does not support the query statement.
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.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.TranslatorException: Pricebook2 does not support the query statement.
at org.teiid.translator.salesforce.execution.visitors.SelectVisitor.visit(SelectVisitor.java:129)
at org.teiid.language.NamedTable.acceptVisitor(NamedTable.java:66) [teiid-api-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.language.visitor.AbstractLanguageVisitor.visitNodes(AbstractLanguageVisitor.java:63) [teiid-api-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.translator.salesforce.execution.visitors.SelectVisitor.visit(SelectVisitor.java:58)
at org.teiid.language.Select.acceptVisitor(Select.java:110) [teiid-api-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.translator.salesforce.execution.QueryExecutionImpl.execute(QueryExecutionImpl.java:138)
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.GeneratedMethodAccessor97.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
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
7 years, 9 months
[JBoss JIRA] (TEIID-4460) A view field defined as clob, on a google spreadsheeet model, returns data truncated to string type length
by Marco Ardito (JIRA)
Marco Ardito created TEIID-4460:
-----------------------------------
Summary: A view field defined as clob, on a google spreadsheeet model, returns data truncated to string type length
Key: TEIID-4460
URL: https://issues.jboss.org/browse/TEIID-4460
Project: Teiid
Issue Type: Bug
Reporter: Marco Ardito
Assignee: Steven Hawkins
A google spreadsheet model text cell can contain way more data than the string type, and even if it is identified by teiid as string (4000 chars), the returned data is the whole original text, ie: it could be more than 4000 chars.
A view that selects from the "native" method of the model, and defines the field as clob, though, returns only first 4000 chars, so it appears to be truncated.
As you can find in the forum reference, where you'll find more descriptive infos, examples and pictures, it seems that "It looks like the issue is that the implicit array_get operation is truncating the string - but it should not be"
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
7 years, 9 months
[JBoss JIRA] (TEIID-4213) Cassandra translator: enable pushdown of aggregate functions
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-4213?page=com.atlassian.jira.plugin... ]
Ramesh Reddy reassigned TEIID-4213:
-----------------------------------
Assignee: Ramesh Reddy (was: JieRen JieRen)
> Cassandra translator: enable pushdown of aggregate functions
> ------------------------------------------------------------
>
> Key: TEIID-4213
> URL: https://issues.jboss.org/browse/TEIID-4213
> Project: Teiid
> Issue Type: Feature Request
> Components: Misc. Connectors
> Affects Versions: 8.12.x
> Reporter: Jan Stastny
> Assignee: Ramesh Reddy
> Priority: Minor
> Fix For: Open To Community, 9.1
>
>
> Cassandra supports basic aggregate functions:
> MIN(),MAX(),SUM() and AVG()
> Currently Teiid doesn't push such queries.
> NOTE:In case of AVG() there is difference between the values returned from Teiid vs. Cassandra for an integer column. Cassandra returns only whole part of the number as integer, Teiid returns bigdecimal.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
7 years, 9 months
[JBoss JIRA] (TEIID-4452) Pushdown SQL/XML
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-4452?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-4452:
---------------------------------------
TEIID-4459 will be looked at for 9.1 as well to provide a better solution at a baseline for using scalar subqueries in the select clause.
> Pushdown SQL/XML
> ----------------
>
> Key: TEIID-4452
> URL: https://issues.jboss.org/browse/TEIID-4452
> Project: Teiid
> Issue Type: Enhancement
> Components: JDBC Connector
> Affects Versions: 9.x
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
>
> It would be helpful to pushdown SQL/XML functions for JDBC databases that support them.
> Databases:
> - Oracle
> - Postgres
> Functions:
> - XMLELEMENT
> - XMLATTRIBUTES
> - XMLAGG
> - XMLCONCAT
> We have an application that uses these functions and we support Oracle, Postgres, and Teiid (to integrate external data sources). Here's an example query generated by this application:
> {code:xml}
> select
> "ITEMS"."ITEM_ID" "ITEM_ID",
> (
> select xmlelement (
> name "attributes",
> xmlagg(
> xmlelement(
> name "attribute",
> xmlattributes(
> "ITEM_ATTRIBUTES"."ATTR_NAME" as "name",
> "ITEM_ATTRIBUTES"."ATTR_VALUE" as "value"
> )
> )
> )
> )
> from "ITEM_ATTRIBUTES" "ITEM_ATTRIBUTES"
> where (
> "ITEMS"."ITEM_ID" = "ITEM_ATTRIBUTES"."ITEM_ID"
> )
> ) "ITEM_ATTRIBUTES"
> {code}
> {code}
> ITEM_ID ITEM_ATTRIBUTES
> 3 <attributes><attribute name="foo" value="bar"></attribute><attribute name="baz" value="blah"></attribute></attributes>
> 4 <attributes><attribute name="foo" value="123"></attribute><attribute name="baz" value="456"></attribute></attributes>
> {code}
> When we are using Teiid queries like this do not work well because they cannot be pushed down, so we get N-many queries (one per row) and the query ends up taking much longer than if performed directly against Oracle/Postgres.
> Since SQL/XML is standard and supported by both Oracle/Postgres it would be good if queries like this could be pushed in their entirety so that there would be no performance difference between going through Teiid and native.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
7 years, 9 months