Bulk Write RowsAdmin Scope

Notes:
  • Ensure you have installed the required package to use this SDK method.

  • A maximum of 100,000 rows can be written at one time.

You can perform bulk write jobs on a specific table present in the Catalyst DataStore. Using the bulk write utility you can fetch thousands of records stored in a .CSV file uploaded to a bucket in Stratus, and insert them to a specific table.

The required table is referred to by its table ID, and the required column will be referred to by its column ID.

Note: To perform the bulk write operation, you need to ensure that the required .CSV file is uploaded to a bucket in Catalyst Stratus. The .CSV file will be referred to using a JSON object which contains details, such as the bucket name, object name, and, if versioning is enabled for your bucket, its version ID.

Methods Used

Methods Used Description
bulkWrite.createJob(objectDetails,{find_by, fk_mapping, operation}) Create a new bulk write job on a specific table.
bulkWrite.status(job ID) Get the status of a bulk write operation.
bulkWrite.result(job ID) Get the result of a bulk write operation.

The datastore reference used in the following code snippet is the component instance.

copy
const objectDetails = {
  bucket_name: "zylker14266",
  object_key: "sample.csv",
  version_id: "64832huidksnd83"
};
const datastore = new Datastore(); // get datastore instance
const bulkWrite = datastore.table("sampleTable").bulkJob("write");
const bulkWriteJob = await bulkWrite.createJob(objectDetails, {
  find_by: "EmpID",
  fk_mapping: [
    { local_column: "EmployeeID", reference_column: "EmpID" },
    { local_column: "DepartmentID", reference_column: "DeptID" }
  ],
  operation: "insert"
});

Get Bulk Write Status

copy
await bulkWrite.getStatus(bulkWriteJob.job_id);

Get Bulk Write Result

Note: The bulk write job status must be Completed for the result to be retrieved successfully.
copy
await bulkWrite.getResult(bulkWriteJob.job_id);

Last Updated 2026-07-02 14:51:41 +0530 IST