apache/beam · error · UnsupportedOperationException

char type not supported yet (https://github.com/apache/beam/

Error message

char type not supported yet (https://github.com/apache/beam/issues/21102)

What it means

This UnsupportedOperationException is thrown by PrimitiveSbeField.beamType when an SBE schema field has primitive type CHAR. The Beam SBE extension does not yet know how to map the CHAR primitive onto a Beam FieldType; support is tracked in Beam issue 21102, so the mapping code fails fast instead of producing a wrong schema.

Source

Thrown at sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java:49

  @Override
  public abstract String name();

  @Override
  public abstract Boolean isRequired();

  public abstract PrimitiveType type();

  @Override
  public Field asBeamField(SbeFieldOptions options) {
    FieldType type = beamType(options);
    return isRequired() ? Field.of(name(), type) : Field.nullable(name(), type);
  }

  private FieldType beamType(SbeFieldOptions options) {
    switch (type()) {
      case CHAR:
        // TODO(https://github.com/apache/beam/issues/21102): Support char types
        throw new UnsupportedOperationException(
            "char type not supported yet (https://github.com/apache/beam/issues/21102)");
      case INT8:
        return FieldType.BYTE;
      case INT16:
        return FieldType.INT16;
      case INT32:
        return FieldType.INT32;
      case INT64:
        return FieldType.INT64;
      case FLOAT:
        return FieldType.FLOAT;
      case DOUBLE:
        return FieldType.DOUBLE;
      case UINT8:
        return convertUint8(options);
      case UINT16:
        return convertUint16(options);
      case UINT32:

View on GitHub (pinned to 12126d8942)

Solutions

  1. Change the SBE schema field from primitiveType="char" to a supported type (e.g. int8/uint8 with a CONVERT_TO_STRING behavior) or an enum/string encoding.
  2. Handle char fields outside Beam's SBE reader, e.g. by mapping them to integers upstream.
  3. Track/await https://github.com/apache/beam/issues/21102 for native char support.
  4. Transform the schema file programmatically to replace char definitions before loading it in Beam.

Example fix

<!-- before -->
<type name="SideChar" primitiveType="char"/>
<!-- after -->
<type name="SideByte" primitiveType="uint8"/>
<!-- plus in options: uint8Behavior CONVERT_TO_STRING -->
Defensive patterns

Strategy: validation

Validate before calling

// Pre-scan the SBE schema XML for char primitives
boolean hasChar = schemaXml.contains("primitiveType=\"char\"");
if (hasChar) throw new IllegalStateException("SBE schema uses unsupported char fields");

Try / catch

try {
  PCollection<Row> rows = pipeline.apply(SbeIO.readMessages(...));
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("char type not supported")) {
    // fall back to a transformed schema without char primitives
  }
}

Prevention

When it happens

Trigger: Reading an SBE schema (XML) whose <type primitiveType="char"/> field is encountered during schema-to-Beam-FieldType translation via PrimitiveSbeField.type().

Common situations: Using SBE message schemas generated from FIX-style dictionaries that commonly use char fields (e.g. 35=MsgType, side indicators); converting legacy FIX/SBE schemas to Beam pipelines.

Related errors


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