[
https://issues.redhat.com/browse/TEIIDSB-213?page=com.atlassian.jira.plug...
]
Renat Eskenin commented on TEIIDSB-213:
---------------------------------------
We have bug with concrete request in concrete SObject [Regular_Articles__kav]:
This request *didn't work* in sf as need, because return 0 records.
It is BUG in Salesforce. Salesforce (because we have bug in it) do not return data for
this request to Regular_Articles__kav with used aliases for this table.
{code}
SELECT a.ArticleNumber,a.Id,a.KnowledgeArticleId,a.Language FROM Regular_Articles__kav a
WHERE a.Language = 'it' LIMIT 5
{code}
When we try to execute this as SQL in teiid we got this log:
{code}
[2020-06-26 17:42:07,488 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.BUFFER_MGR
[workerPool-0]: Ecs7P/wl/YGs.0.0.0 Blocking on
source query Ecs7P/wl/YGs.0.0.0
[2020-06-26 17:42:07,488 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.BUFFER_MGR
[workerPool-0]: Ecs7P/wl/YGs.0 Blocking on source
request(s).
[2020-06-26 17:42:07,488 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[workerPool-0]: Request Thread Ecs7P/wl/YGs.0 -
processor blocked
[2020-06-26 17:42:07,488 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[Worker0_QueryProcessorQueue0]: Running task for
parent thread workerPool-0
[2020-06-26 17:42:07,488 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]: Ecs7P/wl/YGs.0.0.0
Processing NEW request: SELECT g_0.ArticleNumber, g_0.Id, g_0.KnowledgeArticleId,
g_0."Language" FROM salesforce.Regular_Articles__kav AS g_0 WHERE
g_0."Language" = 'it' LIMIT 5
[2020-06-26 17:42:07,491 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]: Ecs7P/wl/YGs.0.0.0
Obtained execution
[2020-06-26 17:42:07,492 CEST] DEBUG [salesforce-failover-facade,,,]
org.teiid.COMMAND_LOG.SOURCE
[Worker0_QueryProcessorQueue0]: START DATA SRC COMMAND: startTime=2020-06-26
17:42:07.491 requestID=Ecs7P/wl/YGs.0 sourceCommandID=0 executionID=0 txID=null modelName=salesforce translatorName=mysalesforce sessionID=Ecs7P/wl/YGs principal=anonymous sql=SELECT
g_0.ArticleNumber, g_0.Id, g_0.KnowledgeArticleId, g_0."Language" FROM
salesforce.Regular_Articles__kav AS g_0 WHERE g_0."Language" = 'it'
LIMIT 5
[2020-06-26 17:42:07,497 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]:
salesforce.Ecs7P/wl/YGs.Ecs7P/wl/YGs.0.0: Incoming Query: SELECT g_0.ArticleNumber,
g_0.Id, g_0.KnowledgeArticleId, g_0.Language FROM Regular_Articles__kav AS g_0 WHERE
g_0.Language = 'it' LIMIT 5
[2020-06-26 17:42:07,505 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]:
salesforce.Ecs7P/wl/YGs.Ecs7P/wl/YGs.0.0: Executing Query: SELECT
Regular_Articles__kav.ArticleNumber, Regular_Articles__kav.Id,
Regular_Articles__kav.KnowledgeArticleId, Regular_Articles__kav.Language FROM
Regular_Articles__kav WHERE Regular_Articles__kav.Language = 'it' LIMIT 5
[2020-06-26 17:42:07,505 CEST] DEBUG [salesforce-failover-facade,,,]
org.teiid.COMMAND_LOG.SOURCE
[Worker0_QueryProcessorQueue0]: SOURCE SRC COMMAND: endTime=2020-06-26
17:42:07.505 requestID=Ecs7P/wl/YGs.0 sourceCommandID=0 executionID=0 txID=null modelName=salesforce translatorName=mysalesforce sessionID=Ecs7P/wl/YGs principal=anonymous sourceCommand=[SELECT
Regular_Articles__kav.ArticleNumber, Regular_Articles__kav.Id,
Regular_Articles__kav.KnowledgeArticleId, Regular_Articles__kav.Language FROM
Regular_Articles__kav WHERE Regular_Articles__kav.Language = 'it' LIMIT 5]
[2020-06-26 17:42:10,412 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]: Ecs7P/wl/YGs.0.0.0
Executed command
[2020-06-26 17:42:10,412 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]: Ecs7P/wl/YGs.0.0.0
Processing MORE request
[2020-06-26 17:42:10,412 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]: Ecs7P/wl/YGs.0.0.0
Getting results from connector
[2020-06-26 17:42:10,414 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[Worker0_QueryProcessorQueue0]: Ecs7P/wl/YGs.0.0.0
Obtained last batch, total row count: 0
[2020-06-26 17:42:10,415 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[workerPool-0]: Request Thread Ecs7P/wl/YGs.0 with
state PROCESSING
[2020-06-26 17:42:10,416 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[workerPool-0]: Ecs7P/wl/YGs.0.0.0 Remove State
[2020-06-26 17:42:10,416 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[workerPool-0]: Ecs7P/wl/YGs.0.0.0 Processing Close
: SELECT g_0.ArticleNumber, g_0.Id, g_0.KnowledgeArticleId, g_0."Language" FROM
salesforce.Regular_Articles__kav AS g_0 WHERE g_0."Language" = 'it'
LIMIT 5
[2020-06-26 17:42:10,416 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[workerPool-0]: SynchQueryExecution.close() called
[2020-06-26 17:42:10,416 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[workerPool-0]: Ecs7P/wl/YGs.0.0.0 Closed
execution
[2020-06-26 17:42:10,416 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.CONNECTOR
[workerPool-0]: Ecs7P/wl/YGs.0.0.0 Closed
connection
[2020-06-26 17:42:10,417 CEST] DEBUG [salesforce-failover-facade,,,]
org.teiid.COMMAND_LOG.SOURCE [workerPool-0]: END SRC
COMMAND: endTime=2020-06-26
17:42:10.417 requestID=Ecs7P/wl/YGs.0 sourceCommandID=0 executionID=0 txID=null modelName=salesforce translatorName=mysalesforce sessionID=Ecs7P/wl/YGs principal=anonymous finalRowCount=0 cpuTime(ns)=30057445
[2020-06-26 17:42:10,417 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[workerPool-0]: QueryProcessor: closing processor
[2020-06-26 17:42:10,417 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[workerPool-0]: Ecs7P/wl/YGs.0 Finished Processing
[2020-06-26 17:42:10,417 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[workerPool-0]:
[RequestWorkItem.sendResultsIfNeeded] requestID: Ecs7P/wl/YGs.0 resultsID: 2 done: true
[2020-06-26 17:42:10,417 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.BUFFER_MGR
[workerPool-0]: Ecs7P/wl/YGs.0 Blocking to allow
asynch processing
[2020-06-26 17:42:10,417 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.PROCESSOR
[workerPool-0]: Request Thread Ecs7P/wl/YGs.0 -
processor blocked
[2020-06-26 17:42:10,418 CEST] DEBUG [salesforce-failover-facade,,,] org.teiid.jdbc
[workerPool-0]: Successfully executed a query
SELECT a.ArticleNumber,a.Id,a.KnowledgeArticleId,a.Language FROM Regular_Articles__kav a
WHERE a.Language = 'it' LIMIT 5 and obtained results
{code}
And teiid do not return data too, of course.
Next variant of request *worked* in Salesforce (returned real number of rows, not 0).
Because we do not used aliases for this table.
{code}
SELECT ArticleNumber,Id,KnowledgeArticleId,Language FROM Regular_Articles__kav WHERE
Language = 'it' LIMIT 5
{code}
Whed we call this request in Teiid we get an exception:
{code}
Caused by: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback;
uncategorized SQLException for SQL [SELECT ArticleNumber,Id,KnowledgeArticleId,Language
FROM Regular_Articles__kav WHERE Language = 'it' LIMIT 5]; SQL state [50000];
error code [0]; TEIID31100 Parsing error: Encountered
",KnowledgeArticleId,[*]Language[*] FROM Regular_Articles__kav" at line 1,
column 44.
Was expecting: "char" | "date" | "time" |
"timestamp" | "cast" | "convert" | "any" |
"array" | "array_agg" | "case" ...; nested exception is
org.teiid.jdbc.TeiidSQLException: TEIID31100 Parsing error: Encountered
",KnowledgeArticleId,[*]Language[*] FROM Regular_Articles__kav" at line 1,
column 44.
Was expecting: "char" | "date" | "time" |
"timestamp" | "cast" | "convert" | "any" |
"array" | "array_agg" | "case" ...
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1442)
{code}
How we can call this request in teiid without aliases and exceptions?
We have strange behavior with aliases
-------------------------------------
Key: TEIIDSB-213
URL:
https://issues.redhat.com/browse/TEIIDSB-213
Project: Teiid Spring Boot
Issue Type: Bug
Components: datasource
Reporter: Renat Eskenin
Priority: Major
We have two SOQL
SELECT ArticleNumber,Id,KnowledgeArticleId,Language FROM Regular_Articles__kav WHERE
Language = 'it' LIMIT 5
SELECT a.ArticleNumber,a.Id,a.KnowledgeArticleId,a.Language FROM Regular_Articles__kav a
WHERE a.Language = 'it' LIMIT 5
This SOQL requests get different responses from SF because in second request we have
alias for table.
It is mystics from SF (we made bug in sf)
How we can call
SELECT ArticleNumber,Id,KnowledgeArticleId,Language FROM Regular_Articles__kav WHERE
Language = 'it' LIMIT 5
in Teiid without aliases?
--
This message was sent by Atlassian Jira
(v7.13.8#713008)