Salesforce Batch Source plugin uses Bulk API by default. Bulk API can not be used with some types of SOQL queries and compound fields. To avoid such limitations replacing of unsupported field types with supported equivalent or by switching to SOAP API options can be used.
Use case
Limitation
Use Case
Approach
Compound fields
Support compound field types: address, location.
For example, Account SObject contains two compound fields: BillingAddress, ShippingAddress.
User should be able to execute SOQL which includes such fields:
SELECT ShippingAddress, BillingAddress FROM Account
Implement compound fields processing strategy.
EXCLUDE- compound fields will be excluded from SOQL. Processing type: Bulk API. Default strategy.
FLATTEN - compound fields will be replaced with individual fields.Processing type: Bulk API.
Example: BillingAddress field will be replaced with:
Adapt existing WideObject query processing to query all SOQL queries with OFFSET clause. Processing type: Bulk API + SOAP API.
Note: performance may be impacted.
Aggregate functions
Functions: COUNT, SUM
User should be able to execute SOQL with aggregate functions:
SELECT Id,count(Name) cnt,count(Name),sum(Amount),count(CloseDate) FROM Opportunity GROUP BY Id
New SOAP API query() reader should be implemented.
Limitations:
Query cannot be processed in batches. All work will be done by one mapper. Performance can be significantly impacted.
Wide queries are not supported, i.e. if user provides query that exceeds the 20,000 character limit, switch to WideObject query processing is not possible, pipeline will fail.
Aggregate Relationships
Relationships: ROLLUP, GROUP BY CUBE
User should be able to execute SOQL with aggregate relationships:
SELECT Status, LeadSource, COUNT(Name) cnt FROM Lead GROUP BY ROLLUP(Status, LeadSource)
SELECT Type, BillingCountry, GROUPING(Type) grpType, GROUPING(BillingCountry) grpCty, COUNT(id) accts FROM Account GROUP BY CUBE(Type, BillingCountry) ORDER BY GROUPING(Type), GROUPING(BillingCountry)
New SOAP API query() reader should be implemented.
Limitations:
Query cannot be processed in batches. All work will be done by one mapper. Performance can be significantly impacted.
Wide queries are not supported, i.e. if user provides query that exceeds the 20,000 character limit, switch to WideObject query processing is not possible, pipeline will fail.
Nested SOQL queries
User should be able to execute SOQL with nested SOQL query:
SELECT Id,Account.Name, (SELECT Id,Name,Contact.LastName FROM Account.Contacts) FROM Account
New SOAP API query() reader should be implemented.
Limitations:
Query cannot be processed in batches. All work will be done by one mapper. Performance can be significantly impacted.
Wide queries are not supported, i.e. if user provides query that exceeds the 20,000 character limit, switch to WideObject query processing is not possible, pipeline will fail.
Plugin Type
This is not a new plugin, but enhancements to the existing plugin.
Design
Approach(s)
Properties
Add property to Salesforce Batch Source plugin Advanced section
User Facing Name
Type
Default
Description
Compound Fields
List of predefined values.
EXCLUDE
Compound fields processing strategy. Compound fields group together multiple elements of primitive data types, such as numbers or strings, to represent complex data types, such as a location or an address. Can be one of three options:
EXCLUDE - compound fields will be excluded from SOQL. Processing type: Bulk API. Default strategy.
FLATTEN - compound fields will be replaced with individual fields. Processing type: Bulk API.
Example: BillingAddress field will be replaced with: