{"record":{"id":"ed02fc321e4ffdc8","repo":"apache/beam","slug":"got-a-state-that-is-not-recognized-type-primitivename","errorCode":null,"errorMessage":"Got a state that is not recognized: ${type().primitiveName()}","messagePattern":"Got a state that is not recognized: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java","lineNumber":72,"sourceCode":"        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:\n        return convertUint32(options);\n      case UINT64:\n        return convertUint64(options);\n      default:\n        throw new IllegalStateException(\n            \"Got a state that is not recognized: \" + type().primitiveName());\n    }\n  }\n\n  private static FieldType convertUint8(SbeFieldOptions options) {\n    Behavior behavior = options.unsignedOptions().uint8Behavior();\n    switch (behavior) {\n      case SAME_BIT_SIGNED:\n        return FieldType.BYTE;\n      case HIGHER_BIT_SIGNED:\n        return FieldType.INT16;\n      case CONVERT_TO_STRING:\n        return FieldType.STRING;\n      case CONVERT_TO_BIG_DECIMAL:\n        return FieldType.DECIMAL;\n      default:\n        throw new IllegalStateException(\"Unrecognized uint8 behavior: \" + behavior.name());\n    }","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java#L54-L90","documentation":"This IllegalStateException is thrown by PrimitiveSbeField.beamType when the SBE field's PrimitiveType does not match any case in the mapping switch and hits the default branch. It indicates the extension encountered a primitive type it does not recognize or that was added later, i.e. an unhandled state in the type-translation logic.","triggerScenarios":"Translating an SBE schema field whose primitive type (e.g. a newly added SBE PrimitiveType not covered by the switch) falls through to the default case in beamType().","commonSituations":"Schemas using SBE primitive types beyond the covered set (CHAR handled separately, int8/16/32/64, uint8/16/32/64); newer SBE library versions introducing types the Beam extension predates.","solutions":["Use a supported SBE primitive type (int8/16/32/64, uint8/16/32/64) in the schema.","Upgrade the Beam SBE extension / Beam version to one that recognizes the type.","If custom types are in play, preprocess the schema to map them onto supported primitives.","File/consult https://github.com/apache/beam to have the type handled explicitly."],"exampleFix":"// before\n<type name=\"MyType\" primitiveType=\"someUnsupported\"/>\n// after\n<type name=\"MyType\" primitiveType=\"int64\"/>","handlingStrategy":"try-catch","validationCode":"Set<String> supported = Set.of(\"INT8\",\"INT16\",\"INT32\",\"INT64\",\"UINT8\",\"UINT16\",\"UINT32\",\"UINT64\");\n// check each field's primitiveType against 'supported' before running","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.apply(SbeIO.readMessages(...));\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Got a state that is not recognized\")) {\n    // report unsupported primitive type and abort or use fallback schema\n  }\n}","preventionTips":["Use only SBE primitive types supported by the extension.","Keep Beam and the SBE extension upgraded together.","Pre-validate schema primitive types before submission.","Report unsupported primitives upstream to the Beam project."],"tags":["java","sbe","unhandled-switch-case","internal"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}