apache/beam · error

ElementType missing on ArrayType

Error message

ElementType missing on ArrayType

What it means

RowCoder was asked to build a coder for a schema field of type arrayType, but the type information carried no elementType. The element type is the only input needed to construct the IterableCoder for an array field, so a missing elementType means the schema proto was built incorrectly or truncated upstream.

Solutions

  1. Ensure the schema passed to RowCoder (e.g. from RowCoder.inferSchemaOfJSON or a Schema proto) sets arrayType.elementType for every array field.
  2. If building the type info by hand, populate the elementType oneof arm of the arrayType before constructing the coder.
  3. Inspect the offending field with JSON.stringify(typeInfo) to confirm which array field is missing its element type.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

          // case AtomicType.FLOAT:
          // case AtomicType.DOUBLE:
          case AtomicType.STRING:
            return new StrUtf8Coder();
          case AtomicType.BOOLEAN:
            return new BoolCoder();
          default:
            throw new Error(
              `Encountered an Atomic type that is not currently supported by RowCoder: ${atomicType}`,
            );
        }
        break;
      case "arrayType":
        if (typeInfo.arrayType.elementType !== undefined) {
          return new IterableCoder(
            this.getCoderFromType(typeInfo.arrayType.elementType),
          );
        } else {
          throw new Error("ElementType missing on ArrayType");
        }
      // case "iterableType":
      // case "mapType":
      case "rowType":
        if (typeInfo.rowType.schema !== undefined) {
          return RowCoder.fromSchema(typeInfo.rowType.schema);
        } else {
          throw new Error("Schema missing on RowType");
        }
        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) =>

View on GitHub (pinned to 12126d8942)