apache/beam · error

Ephemeral coder.

Error message

Ephemeral coder.

What it means

This is a sentinel error from the toProto method of an ad-hoc coder synthesized for a logical type. The coder wraps a representation coder with toRepr/fromRepr conversions at encode/decode time, but it cannot serialize itself back to a coder proto; asking it for its proto (e.g. when the pipeline is translated) raises this guard. The input at fault is the logicalType field being converted to a pipeline proto, not any data element.

Solutions

  1. Avoid code paths that call toProto on coders derived from logical types; these ephemeral coders only support encode/decode within an already-materialized RowCoder.
  2. Register the logical type's proto urn and representation in the logicalTypes registry so a proto-expressible coder can be produced instead.
  3. If you control the pipeline construction, pre-compute the coder protos before wrapping logical types.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

        }
        break;
      case "logicalType":
        const logicalTypeInfo = logicalTypes.get(typeInfo.logicalType.urn);
        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);
  }

View on GitHub (pinned to 12126d8942)