{"record":{"id":"46a7f01cd384f702","repo":"apache/beam","slug":"unimplemented-access-pattern-accesspattern","errorCode":null,"errorMessage":"Unimplemented access pattern: ${accessPattern}","messagePattern":"Unimplemented access pattern: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/worker/pardo_context.ts","lineNumber":266,"sourceCode":"  const writer = new protobufjs.Writer();\n  windowCoder.encode(window, writer, CoderContext.needsDelimiters);\n  const encodedWindow = writer.finish();\n\n  switch (accessPattern) {\n    case \"beam:side_input:iterable:v1\":\n      return {\n        type: {\n          oneofKind: \"iterableSideInput\",\n          iterableSideInput: {\n            transformId: transformId,\n            sideInputId: sideInputId,\n            window: encodedWindow,\n          },\n        },\n      };\n\n    default:\n      throw new Error(\"Unimplemented access pattern: \" + accessPattern);\n  }\n}\n","sourceCodeStart":248,"sourceCodeEnd":269,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/worker/pardo_context.ts#L248-L269","documentation":"createStateKey builds a Fn API StateKey for a state cell given its access pattern (BAG, MULTIMAP, etc.). An unrecognized accessPattern falls through to a default that throws this Error — the TypeScript worker does not implement state access for that pattern.","triggerScenarios":"DoFn state cell declares an access pattern the worker's createStateKey switch doesn't cover (only bag/multimap-style patterns are implemented); usually from a newer SDK spec or an exotic state family.","commonSituations":"User state features (orderly list, SetState, or new state types) added in a recent Beam release used with an older TS worker.","solutions":["Upgrade the TypeScript worker to a build implementing the access pattern.","Replace the DoFn state cell with a supported access pattern (e.g. BagState) in user code.","Inspect the StateSpec to confirm the access pattern and open/track a Beam issue if it should be supported."],"exampleFix":"// before\n// self.state = beam.pvalue.AsBag? -> uses unsupported ORDERED_LIST access pattern\n// after\n// declare the cell as BagState (read_iterable/write) which the TS worker implements","handlingStrategy":"validation","validationCode":"// verify state spec access pattern before wiring user state\nconst supported = new Set(['BAG', 'MULTIMAP']);\nif (stateSpec.accessPattern && !supported.has(stateSpec.accessPattern)) {\n  throw new Error(`Precheck: access pattern ${stateSpec.accessPattern} not implemented in TS worker`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use BagState/MultimapState style state in DoFns targeting the TS worker","Upgrade worker before using newly introduced state types","Audit pipeline protos for state specs when migrating runners"],"tags":["beam","worker","state-api","unimplemented"],"backgroundTag":"method-not-implemented","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}