{"record":{"id":"aa743787c57cc193","repo":"apache/beam","slug":"unrecognized-uint32-behavior-behavior-name","errorCode":null,"errorMessage":"Unrecognized uint32 behavior: ${behavior.name()}","messagePattern":"Unrecognized uint32 behavior: (.+?)","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":121,"sourceCode":"        return FieldType.DECIMAL;\n      default:\n        throw new IllegalStateException(\"Unrecognized uint16 behavior: \" + behavior.name());\n    }\n  }\n\n  private static FieldType convertUint32(SbeFieldOptions options) {\n    Behavior behavior = options.unsignedOptions().uint32Behavior();\n    switch (behavior) {\n      case SAME_BIT_SIGNED:\n        return FieldType.INT32;\n      case HIGHER_BIT_SIGNED:\n        return FieldType.INT64;\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 uint32 behavior: \" + behavior.name());\n    }\n  }\n\n  private static FieldType convertUint64(SbeFieldOptions options) {\n    Behavior behavior = options.unsignedOptions().uint64Behavior();\n    switch (behavior) {\n      case SAME_BIT_SIGNED:\n        return FieldType.INT64;\n      case HIGHER_BIT_SIGNED:\n        throw new IllegalStateException(\n            \"Options say to use higher bit type, but that is impossible for 64-bit integers.\");\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 uint64 behavior: \" + behavior.name());\n    }","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java#L103-L139","documentation":"This IllegalStateException is thrown by PrimitiveSbeField.convertUint32 when the configured uint32Behavior is not among the Behavior values handled in the switch. Like its uint8/uint16 counterparts, it is a default-branch guard that fails fast rather than mapping a 32-bit unsigned field to an unintended Beam FieldType.","triggerScenarios":"Translating a uint32 SBE field whose SbeFieldOptions.unsignedOptions().uint32Behavior() contains a Behavior value the switch does not recognize.","commonSituations":"Behavior enum/switch drift across Beam versions; options built programmatically with values outside the supported set.","solutions":["Set uint32Behavior to SAME_BIT_SIGNED, HIGHER_BIT_SIGNED, CONVERT_TO_STRING, or CONVERT_TO_BIG_DECIMAL.","Use matching Beam/SBE extension versions so enum and switch are consistent.","Correct the uint32 behavior in SBE pipeline options.","Validate configured behaviors before schema translation."],"exampleFix":"// before\noptions.setUint32Behavior(someInvalidBehavior);\n// after\noptions.setUint32Behavior(Behavior.CONVERT_TO_BIG_DECIMAL);","handlingStrategy":"validation","validationCode":"Behavior b = options.unsignedOptions().uint32Behavior();\nif (b != Behavior.SAME_BIT_SIGNED && b != Behavior.HIGHER_BIT_SIGNED\n    && b != Behavior.CONVERT_TO_STRING && b != Behavior.CONVERT_TO_BIG_DECIMAL) {\n  throw new IllegalArgumentException(\"unsupported uint32Behavior: \" + b);\n}","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.apply(SbeIO.readMessages(...));\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Unrecognized uint32 behavior\")) {\n    // fix uint32Behavior in options and rebuild\n  }\n}","preventionTips":["Use documented Behavior values for uint32Behavior.","Keep SbeFieldOptions construction in one versioned module.","Validate all unsigned behaviors before translation.","Prefer explicit named constants over dynamic behavior lookup."],"tags":["java","sbe","unhandled-switch-case","configuration"],"backgroundTag":"unsupported-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"}