function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrew Morales 1Andrew Morales 1 

"Aggregate Relationships not supported in Bulk Query" (SOQL Question)

Hello Brililant People,

I am hoping that you can help me with what I am thinking is a easy(ish) question.

I am using a 3rd party data-tool that rhymes with betamoader.io and I am trying to sched a query > export to a sFTP site so we can collect metrics to do trend analysis. We have a very large data set (6M+ Contacts) that I have to query and I am just interested in the total num of records based on GROUPBy, not the PII of our Contacts. So think -'Total Num of Signups by Country and Language'

The query I wrote:
SELECT Email_Language__c, MailingCountry, COUNT(Id)
FROM Contact
WHERE SubscriberMaster__c = True AND (Double_Opt_In__c = True AND HasOptedOutOfEmail = False)
GROUP BY Email_Language__c, MailingCountry

Error from betamoader.io:
InvalidBatch : Failed to process query: FUNCTIONALITY_NOT_ENABLED: Aggregate Relationships not supported in Bulk Query

Kickers:
- After 100K records are queried, the tool will not allow me to choose to do it in Batch Mode. so that is not an option.
- I (have) successfully completed an extract with the query above to an sFTP with the tool by fudging the system by rerunning an old job and replacing the query. But it bricks again when it runs at the selected scheduled time.

Question
Is there a way to better optimize my query?

I dont understand the error of Aggregating Relationships, I am just trying to Group data on the Contact object. I am not trying to pull related data tables.





 
Dilip_VDilip_V
Andrew,

That functionality is yet to impliment it seems.Take a look at this idea.
https://success.salesforce.com/ideaView?id=08730000000h6C2AAI

Thanks.