{"record":{"id":"60192ed252d47025","repo":"apache/beam","slug":"only-const-and-zipf-distributions-are-supported-for","errorCode":null,"errorMessage":"Only const and zipf distributions are supported for determining sizes of bundles produced by initial splitting. Received: %s","messagePattern":"Only const and zipf distributions are supported for determining sizes of bundles produced by initial splitting\\. Received: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/testing/synthetic_pipeline.py","lineNumber":361,"sourceCode":"    Raises:\n      ValueError: if input parameters are invalid.\n    \"\"\"\n    def maybe_parse_byte_size(s):\n      return parse_byte_size(s) if isinstance(s, str) else int(s)\n\n    self._num_records = input_spec['numRecords']\n    self._key_size = maybe_parse_byte_size(input_spec.get('keySizeBytes', 1))\n    self._hot_key_fraction = input_spec.get('hotKeyFraction', 0)\n    self._num_hot_keys = input_spec.get('numHotKeys', 0)\n\n    self._value_size = maybe_parse_byte_size(\n        input_spec.get('valueSizeBytes', 1))\n    self._total_size = self.element_size * self._num_records\n    self._initial_splitting = (\n        input_spec['bundleSizeDistribution']['type']\n        if 'bundleSizeDistribution' in input_spec else 'const')\n    if self._initial_splitting != 'const' and self._initial_splitting != 'zipf':\n      raise ValueError(\n          'Only const and zipf distributions are supported for determining '\n          'sizes of bundles produced by initial splitting. Received: %s',\n          self._initial_splitting)\n    self._initial_splitting_num_bundles = (\n        input_spec['forceNumInitialBundles']\n        if 'forceNumInitialBundles' in input_spec else 0)\n    if self._initial_splitting == 'zipf':\n      self._initial_splitting_distribution_parameter = (\n          input_spec['bundleSizeDistribution']['param'])\n      if self._initial_splitting_distribution_parameter < 1:\n        raise ValueError(\n            'Parameter for a Zipf distribution must be larger than 1. '\n            'Received %r.',\n            self._initial_splitting_distribution_parameter)\n    else:\n      self._initial_splitting_distribution_parameter = 0\n    self._dynamic_splitting = (\n        'none' if (","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/testing/synthetic_pipeline.py#L343-L379","documentation":"SyntheticSource.__init__ supports only 'const' and 'zipf' distributions for the bundle sizes produced by initial splitting; anything else raises ValueError. It reads input_spec['bundleSizeDistribution']['type'] (defaulting to 'const' when absent).","triggerScenarios":"Passing a pipeline parse spec where bundleSizeDistribution.type is 'uniform', 'normal', or any other unsupported name.","commonSituations":"Reusing a spec JSON written for another synthetic generator with more distribution options; typo ('Zipf', 'constant'); experimenting with distributions not implemented in this module.","solutions":["Set bundleSizeDistribution.type to 'const' or 'zipf'","Remove the bundleSizeDistribution key entirely to get the default 'const' behavior","Fix casing/typos — values must match exactly"],"exampleFix":"// before\n\"bundleSizeDistribution\": {\"type\": \"uniform\", \"seed\": 7}\n// after\n\"bundleSizeDistribution\": {\"type\": \"zipf\", \"seed\": 7}","handlingStrategy":"validation","validationCode":"t = input_spec.get('bundleSizeDistribution', {}).get('type', 'const')\nif t not in ('const', 'zipf'):\n    raise ValueError(f'unsupported bundleSizeDistribution type: {t}')","typeGuard":"def is_supported_splitting(t):\n    return t in ('const', 'zipf')","tryCatchPattern":"try:\n    source = SyntheticSource(spec)\nexcept ValueError as e:\n    _LOGGER.error('%s; falling back to const splitting', e)\n    spec.pop('bundleSizeDistribution', None)\n    source = SyntheticSource(spec)","preventionTips":["Only emit const/zipf in spec generators","Normalize type strings (lowercase/strip) at load time","Validate the parse-spec JSON against a schema before running"],"tags":["invalid-enum","synthetic-pipeline","config"],"backgroundTag":"invalid-enum-value","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"}