apache/beam · error

Unknown logical type

Error message

Unknown logical type: ${typeInfo.logicalType.urn}

What it means

A schema field uses a logicalType whose urn is not present in the logicalTypes registry consulted by getNonNullCoderFromType. The urn on typeInfo.logicalType is the input at fault: it names a logical type this SDK build has no registered implementation for, so no coder can be constructed.

Solutions

  1. Check the urn in the error against the urns exported by the SDK's logicalTypes registry and correct typos or version mismatches in the schema.
  2. Register a custom logical type (urn, toRepr, fromRepr, representation) in the logicalTypes map before constructing the RowCoder.
  3. Regenerate the schema with the same Beam version that will encode/decode the data so logical type urns line up.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at sdks/typescript/src/apache_beam/coders/row_coder.ts:309 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/b28b157fa2930343. Report an issue: GitHub.

Appendix: source

Thrown at sdks/typescript/src/apache_beam/coders/row_coder.ts:309

        if (logicalTypeInfo !== undefined) {
          const reprCoder = this.getCoderFromType(
            typeInfo.logicalType.representation!,
          );
          return {
            encode: (element: any, writer: Writer, context: Context) =>
              reprCoder.encode(
                logicalTypeInfo.toRepr(element),
                writer,
                context,
              ),
            decode: (reader: Reader, context: Context) =>
              logicalTypeInfo.fromRepr(reprCoder.decode(reader, context)),
            toProto: (pipelineContext: ProtoContext) => {
              throw new Error("Ephemeral coder.");
            },
          };
        } else {
          throw new Error(`Unknown logical type: ${typeInfo.logicalType.urn}`);
        }
        break;
      default:
        throw new Error(
          `Encountered a type that is not currently supported by RowCoder: ${JSON.stringify(
            t,
          )}`,
        );
    }
  }

  static fromSchema(schema: Schema): RowCoder {
    return new RowCoder(schema);
  }

  static fromJSON(obj: any): RowCoder {
    return new RowCoder(RowCoder.inferSchemaOfJSON(obj));
  }

View on GitHub (pinned to 12126d8942)