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
irfan azizirfan aziz 

How to split the retrieved data into multiple files in bulk api?

Hi
I managed to run the example code shared here but since my account table in SF has more than 1 million rows and i am extracting all the columns. When tried to run the extraction at 619000 rows giving the heap space error. how can i split the result into multiple files? I expected the program will do the split as bulk is meant to do so but in the given code it did not.

Any idea?
NagendraNagendra (Salesforce Developers) 
Hi Irfan,

Assuming that you want to split large queries into multiple batches using bulk API.
  1. Retrieving the data from BulkApi queries, I hope no problem for you in that.
  2. The data will get received in the form of files with the max. size per file is 1GB.
This function will parallelly start your procedure. and a combination of two fulfill your task completely

Hope the information helps.

Regards,
Nagendra.