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
ragi dayanandaragi dayananda 

On what basis salesforce decides the total number of batches for a job in bulk api?

Hi,

I am retrieving the records from saleforce using bulk api. I created a job and added a batch to it. When I check the job status, saleforce gave me many batches associated to the job. I need to know how saleforce decides the total number of batches in a job for bulk api?
ragi dayanandaragi dayananda
Thanks for the answer. But my question was, though I add only one batch to a job but when I check the job status, I get many batches and each batch would contain different number of records. I need to know how does bulk api algorithm works.
ragi dayanandaragi dayananda

To give more info..
my query looks more like this
SELECT * FROM CampaignMember WHERE Country__c = 'SomeCountry'
AND PRMContact__c = TRUE and SystemModstamp >= 2018-01-02:30:52Z;

I created a job with 'CampaignMember' entity , added a batch with above query to the job and closed the job. When I checked the status of the job, I got around 400 batches in the response. I wonder how did I get 400 batches in the reponse. Also each batch resulted in 10 to 20 records.

I need to know how did I get those many number of batches and what involves in deciding the total number of batches in a job?