{
  "id": 6431829,
  "title": "Partition bulk records into accepted and rejected lists",
  "url": "https://urgent.news/2026/09/09/partition-bulk-records-into-accepted-and-rejected-lists",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-09T15:13:29.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/thasha/partition-bulk-records-into-accepted-and-rejected-lists-2e5"
  },
  "original_language": "en",
  "account": "In order to avoid an unresolved reference error when using the partition function in DataWeave, it is necessary to import the Arrays module from dw::core::Arrays at the beginning of the script. The input data consists of a list of records, each containing an ID and an email address.\n\nThe working configuration involves importing the Arrays module and then using the partition function to divide the records into two groups: those with valid email addresses and those with invalid or missing email addresses. The accepted array contains the IDs of records with valid emails, while the rejected array includes objects with the ID and a reason for rejection (missing or invalid email). Additionally, the script calculates a retryCount field, which is the size of the failure partition.\n\nThe accepted array in the output contains the IDs from records with valid email addresses: ORD-1001, ORD-1003, and ORD-1005. The rejected array holds objects for records with missing or invalid email addresses, such as ORD-1002 and ORD-1004, along with the reason \"missing or invalid email\". The retryCount field is set to 2, indicating the number of records that failed the partition test.",
  "summary": "Problem My DataWeave script threw an unresolved reference error when calling partition without an explicit import. The Arrays module must be imported to your DataWeave code by adding the line import * from dw::core::Arrays to the header of your DataWeave script docs . Input { \"records\" : [ { \"id\" : \"ORD-1001\" , \"email\" : \"ana@example.com\" }, { \"id\" : \"ORD-1002\" , \"email\" : \"bad-address\" }, { \"id\"…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}