-
Bug
-
Resolution: Done
-
Blocker
-
None
-
None
-
Undefined
We have SQL
SELECT ca.Id AS caid, pl.Id AS plId, f.Id AS fid, a.Id AS aid, c.Id AS cid FROM Product_License__c AS pl LEFT OUTER JOIN /*+ MAKEDEP */ LicenseFolder__c AS f ON f.Id = pl.LicenseFolder__c LEFT OUTER JOIN /*+ MAKEDEP */ Account AS a ON pl.LicenseAccount__c = a.Id LEFT OUTER JOIN /*+ MAKEDEP */ Contract AS c ON pl.vlic_Contract__c = c.Id LEFT OUTER JOIN /*+ MAKEDEP */ Account AS ca ON c.accountid = ca.Id WHERE pl.LicenseId__c = 'testId'
Teiid generated SOQL
SELECT vlic_Contract__r.Account.Id, Id, LicenseFolder__r.Id, LicenseAccount__r.Id, vlic_Contract__r.Id FROM Product_License__c WHERE LicenseId__c = 'testId'
In salesforce this SOQL got a response with ids for all columns
a7U0e000000tqZ4EAI 8000e000001SWX6AAO 0010e00001NhkWxAAJ a7r0e0000019wo9AAA 0010e00001NhkWxAAJ
NOTE: 0010e00001NhkWxAAJ is similar in two columns Contract.Account.Id and Account.Id in salesforce response
But teiid generate response with null value for one column (vlic_Contract__r.Account.Id this column in salesforce response is Contract.Account.Id) without duplicated id
[2021-02-09 11:00:56,527 CET] TRACE org.teiid.PROCESSOR [Central-Executor-11]: AccessNode(0) sending TupleBatch; beginning row=1, number of rows=1, lastBatch=1
1: [null, a7U0e000000tqZ4EAI, a7r0e0000019wo9AAA, 0010e00001NhkWxAAJ, 8000e000001SWX6AAO]
generated plan for this SQL
[2021-02-09 11:00:56,262 CET] TRACE org.teiid.COMMAND_LOG [Central-Executor-11]: PLAN USER COMMAND: endTime=2021-02-09 11:00:56.262 requestID=oxdgEbBi9oMh.0 txID=null sessionID=oxdgEbBi9oMh principal=anonymous vdbName=db vdbVersion=1 finalRowCount=null plan=AccessNode: Relational Node ID: 0 Output Columns: - caid (string) - plId (string) - fid (string) - aid (string) - cid (string) Cost Estimates: Estimated Node Cardinality: -1.0 Query: SELECT g_4.Id, g_0.Id, g_1.Id, g_2.Id, g_3.Id FROM (((salesforce.Product_License__c AS g_0 LEFT OUTER JOIN salesforce.LicenseFolder__c AS g_1 ON g_1.Id = g_0.LicenseFolder__c) LEFT OUTER JOIN salesforce.Account AS g_2 ON g_0.LicenseAccount__c = g_2.Id) LEFT OUTER JOIN salesforce.Contract AS g_3 ON g_0.vlic_Contract__c = g_3.Id) LEFT OUTER JOIN salesforce.Account AS g_4 ON g_3.AccountId = g_4.Id WHERE g_0.LicenseId__c = 'testId' Model Name: salesforce
Getting result from response process
org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: oxdgEbBi9oMh.0.0.13 Executed command
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: oxdgEbBi9oMh.0.0.13 Processing MORE request
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: oxdgEbBi9oMh.0.0.13 Getting results from connector
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: SalesForce Object Name = Product_License__c
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: FieldCount = 6
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: Field # 0 is type
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: Field # 1 is Id
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: Field # 2 is vlic_Contract__r
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: Field # 3 is Id
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: Field # 4 is LicenseFolder__r
[2021-02-09 11:00:56,526 CET] DEBUG org.teiid.CONNECTOR [Worker3_QueryProcessorQueue13]: Field # 5 is LicenseAccount__r
As result we have difference between salesforce response for this request and teiid response.