apache/beam · error · ValueError

The field name " " was specified more than once.

Error message

The field name "{k}" was specified more than once.

What it means

Same uniqueness rule as the list form: when 'fields' values are dicts mapping outputName -> sourceColumn, each output name (the dict key k) must be unique across all inputs. A repeated output name raises this ValueError.

Solutions

  1. Choose a distinct output name for one of the conflicting keys.
  2. Rename the other input's output so names do not collide.
  3. Track which output names already exist across all fields entries before adding new ones.

Example fix

// before
fields:
  left: {id: id}
  right: {id: user_id}
// after
fields:
  left: {id: id}
  right: {right_id: user_id}
Defensive patterns

Strategy: validation

Validate before calling

def check_dict_keys_unique(fields):
    seen = set()
    for alias, cols in fields.items():
        if isinstance(cols, dict):
            for k in cols:
                if k in seen:
                    raise ValueError(f'duplicate output name: {k}')
                seen.add(k)

Try / catch

try:
    result = SqlJoinTransform(config)
except ValueError as e:
    if 'specified more than once' in str(e):
        raise ConfigError('output names in fields dicts must be globally unique') from e
    raise

Prevention

When it happens

Trigger: fields: {left: {id: id}, right: {id: user_id}} — both outputs named 'id'; mixing list and dict forms where list form already emitted the same name.

Common situations: Renaming the source column but not the output name, leaving a collision with another table's column; incremental edits adding a key that duplicates an existing output.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/7a87cd4a8c50b692. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/apache_beam/yaml/yaml_join.py:132

  output_fields = []
  named_columns = set()
  for input, cols in fields.items():
    if input not in tables:
      raise ValueError(f'An invalid input "{input}" was specified in "fields".')
    if isinstance(cols, list):
      for col in cols:
        if not isinstance(col, str):
          raise ValueError(
              f'Invalid column "{col}" in "fields". Column name must be a str.')
        if col in named_columns:
          raise ValueError(
              f'The field name "{col}" was specified more than once.')
        output_fields.append(f'{input}.{col} AS {col}')
        named_columns.add(col)
    elif isinstance(cols, dict):
      for k, v in cols.items():
        if k in named_columns:
          raise ValueError(
              f'The field name "{k}" was specified more than once.')
        if not isinstance(v, str):
          raise ValueError(
              f'Invalid column "{v}" in "fields". Column name must be a str.')
        output_fields.append(f'{input}.{v} AS {k}')
        named_columns.add(k)
    else:
      raise ValueError(
          f'{error_prefix} '
          f'For every input key in fields, '
          f'the value must either be a list or dict.')
  for table in tables:
    if table not in fields.keys():
      output_fields.append(f'{table}.*')
  return output_fields


def _is_connected(edge_list, expected_node_count):

View on GitHub (pinned to 12126d8942)