{"record":{"id":"f325364aa1e0c77b","repo":"apache/beam","slug":"unknown-access-pattern-s-execution","errorCode":null,"errorMessage":"Unknown access pattern: '%s'","messagePattern":"Unknown access pattern: '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/fn_api_runner/execution.py","lineNumber":307,"sourceCode":"\nclass WindowGroupingBuffer(object):\n  \"\"\"Used to partition windowed side inputs.\"\"\"\n  def __init__(\n      self,\n      access_pattern: beam_runner_api_pb2.FunctionSpec,\n      coder: WindowedValueCoder) -> None:\n    # Here's where we would use a different type of partitioning\n    # (e.g. also by key) for a different access pattern.\n    if access_pattern.urn == common_urns.side_inputs.ITERABLE.urn:\n      self._kv_extractor = lambda value: ('', value)\n      self._key_coder: coders.Coder = coders.SingletonCoder('')\n      self._value_coder = coder.wrapped_value_coder\n    elif access_pattern.urn == common_urns.side_inputs.MULTIMAP.urn:\n      self._kv_extractor = lambda value: value\n      self._key_coder = coder.wrapped_value_coder.key_coder()\n      self._value_coder = (coder.wrapped_value_coder.value_coder())\n    else:\n      raise ValueError(\"Unknown access pattern: '%s'\" % access_pattern.urn)\n    self._windowed_value_coder = coder\n    self._window_coder = coder.window_coder\n    self._values_by_window: collections.defaultdict[\n        tuple[str, BoundedWindow], list[Any]] = collections.defaultdict(list)\n\n  def append(self, elements_data: bytes) -> None:\n    input_stream = create_InputStream(elements_data)\n    while input_stream.size() > 0:\n      windowed_val_coder_impl: WindowedValueCoderImpl = (\n          self._windowed_value_coder.get_impl())\n      windowed_value = windowed_val_coder_impl.decode_from_stream(\n          input_stream, True)\n      key, value = self._kv_extractor(windowed_value.value)\n      for window in windowed_value.windows:\n        self._values_by_window[key, window].append(value)\n\n  def encoded_items(self) -> Iterator[tuple[bytes, bytes, bytes, int]]:\n    value_coder_impl = self._value_coder.get_impl()","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/fn_api_runner/execution.py#L289-L325","documentation":"When constructing the grouping table for a transform, ExecutionState (fn_api_runner execution.py) inspects the side-input access pattern's URN. Only UNION (merge) and MULTIMAP side-input access patterns are supported; any other URN means the runner cannot interpret how the input will be accessed, so a ValueError is raised at construction time.","triggerScenarios":"A pipeline whose transform declares a side-input access pattern URN other than common_urns.side_inputs.MULTIMAP (or the merge/UNION variant handled in the preceding branch) while running under the fn_api_runner — e.g. an unsupported ITERABLE/MULTIACCESS or newly-added access pattern URN.","commonSituations":"Using side-input types the FnApiRunner does not yet support (e.g. certain view types); version mismatch between SDKs in cross-language pipelines where one SDK emits an access pattern URN the Python runner lacks a branch for; custom transforms declaring custom access patterns.","solutions":["Check which access pattern URN the failing transform declares and switch to a supported side-input type (multimap or merge-compatible view).","Upgrade apache-beam so the runner recognizes the access pattern URN (new URNs are added over time).","If using cross-language transforms, verify both SDKs/harnesses agree on supported side-input access patterns.","Fall back to a different runner (e.g. DirectRunner/FlinkRunner) that supports the access pattern, or restructure the pipeline to avoid the unsupported side input."],"exampleFix":"# before\n# pipeline uses an unsupported side-input view type with fn_api_runner\nresult = p | ReadUnsupportedView()\n# after\n# use a supported side input, e.g. AsDict/AsMultimap style access\nresult = p | \"read\" >> beam.Map(lambda x, side: ..., side=beam.pvalue.AsDict(side_pcoll))","handlingStrategy":"validation","validationCode":"SUPPORTED = {'beam:side_input:multimap:v1', 'beam:side_input:union:v1'}\nif access_pattern.urn not in SUPPORTED:\n    raise ValueError('unsupported side input access pattern: %s' % access_pattern.urn)","typeGuard":"def side_input_supported(access_pattern):\n    return access_pattern.urn in {\n        'beam:side_input:multimap:v1',\n        'beam:side_input:union:v1',\n    }","tryCatchPattern":"try:\n    state = ExecutionState(...)\nexcept ValueError as e:\n    if 'Unknown access pattern' in str(e):\n        raise UnsupportedSideInputError(e)  # fall back to another runner\n    raise","preventionTips":["Stick to side-input types the FnApiRunner documents as supported (multimap views).","Keep SDK versions aligned in cross-language pipelines so access-pattern URNs match.","Pin apache-beam to a version whose runner handles the URNs your pipeline emits.","Test pipelines on the FnApiRunner early to surface unsupported access patterns before deployment."],"tags":["apache-beam","fn-api-runner","side-inputs","unsupported-operation","urn"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}