apache/beam · error · Error

Multiple keys for exclusively split element

Error message

Multiple keys for exclusively split element: ${wvalue.value}

What it means

SplittingDoFnOperator with exclusive split options requires each incoming element to be a plain object carrying exactly one output tag; Object.keys on the element yielded more than one key. The element (wvalue.value) is the input at fault — an exclusively-split DoFn must emit to exactly one output per element.

Solutions

  1. Fix the splitting DoFn so process() emits exactly one keyed output per element when exclusive is set.
  2. If multiple outputs per element are legitimate, configure the operator with exclusive: false and declare the output tags.
  3. Ensure the emitted object isn't accidentally multi-keyed (e.g. spread of extra properties).
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at sdks/typescript/src/apache_beam/worker/operators.ts:826 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at sdks/typescript/src/apache_beam/worker/operators.ts:826

  }

  async finishBundle() {}
}

class SplittingDoFnOperator implements IOperator {
  constructor(
    public transformId: string,
    private receivers: { [key: string]: Receiver },
    private options: SplitOptions,
  ) {}

  async startBundle() {}

  process(wvalue: WindowedValue<unknown>) {
    const result = new ProcessResultBuilder();
    const keys = Object.keys(wvalue.value as object);
    if (this.options.exclusive && keys.length !== 1) {
      throw new Error(
        "Multiple keys for exclusively split element: " + wvalue.value,
      );
    }
    for (let tag of keys) {
      if (!this.options.knownTags!.includes(tag)) {
        if (this.options.unknownTagBehavior === "rename") {
          tag = this.options.unknownTagName!;
        } else if (this.options.unknownTagBehavior === "ignore") {
          continue;
        } else {
          throw new Error(
            "Unexpected tag '" +
              tag +
              "' for " +
              wvalue.value +
              " not in " +
              this.options.knownTags,
          );

View on GitHub (pinned to 12126d8942)