{"record":{"id":"fde453fd5c3acca1","repo":"apache/beam","slug":"char-type-not-supported-yet-https-github-com-apache-beam","errorCode":null,"errorMessage":"char type not supported yet (https://github.com/apache/beam/issues/21102)","messagePattern":"char type not supported yet \\(https://github\\.com/apache/beam/issues/21102\\)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java","lineNumber":49,"sourceCode":"  @Override\n  public abstract String name();\n\n  @Override\n  public abstract Boolean isRequired();\n\n  public abstract PrimitiveType type();\n\n  @Override\n  public Field asBeamField(SbeFieldOptions options) {\n    FieldType type = beamType(options);\n    return isRequired() ? Field.of(name(), type) : Field.nullable(name(), type);\n  }\n\n  private FieldType beamType(SbeFieldOptions options) {\n    switch (type()) {\n      case CHAR:\n        // TODO(https://github.com/apache/beam/issues/21102): Support char types\n        throw new UnsupportedOperationException(\n            \"char type not supported yet (https://github.com/apache/beam/issues/21102)\");\n      case INT8:\n        return FieldType.BYTE;\n      case INT16:\n        return FieldType.INT16;\n      case INT32:\n        return FieldType.INT32;\n      case INT64:\n        return FieldType.INT64;\n      case FLOAT:\n        return FieldType.FLOAT;\n      case DOUBLE:\n        return FieldType.DOUBLE;\n      case UINT8:\n        return convertUint8(options);\n      case UINT16:\n        return convertUint16(options);\n      case UINT32:","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java#L31-L67","documentation":"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.","triggerScenarios":"Reading an SBE schema (XML) whose <type primitiveType=\"char\"/> field is encountered during schema-to-Beam-FieldType translation via PrimitiveSbeField.type().","commonSituations":"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.","solutions":["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.","Handle char fields outside Beam's SBE reader, e.g. by mapping them to integers upstream.","Track/await https://github.com/apache/beam/issues/21102 for native char support.","Transform the schema file programmatically to replace char definitions before loading it in Beam."],"exampleFix":"<!-- before -->\n<type name=\"SideChar\" primitiveType=\"char\"/>\n<!-- after -->\n<type name=\"SideByte\" primitiveType=\"uint8\"/>\n<!-- plus in options: uint8Behavior CONVERT_TO_STRING -->","handlingStrategy":"validation","validationCode":"// Pre-scan the SBE schema XML for char primitives\nboolean hasChar = schemaXml.contains(\"primitiveType=\\\"char\\\"\");\nif (hasChar) throw new IllegalStateException(\"SBE schema uses unsupported char fields\");","typeGuard":null,"tryCatchPattern":"try {\n  PCollection<Row> rows = pipeline.apply(SbeIO.readMessages(...));\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"char type not supported\")) {\n    // fall back to a transformed schema without char primitives\n  }\n}","preventionTips":["Avoid primitiveType=\"char\" in SBE schemas; use uint8 with CONVERT_TO_STRING or enum types.","Pre-validate schemas for unsupported primitives before pipeline submission.","Follow https://github.com/apache/beam/issues/21102 for char support updates.","Keep generated schemas aligned with types the Beam SBE extension supports."],"tags":["java","sbe","unsupported-type","schema"],"backgroundTag":"unsupported-dtype","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}