{"record":{"id":"2b0188e44a40b733","repo":"apache/beam","slug":"unrecognized-uint64-behavior-behavior-name","errorCode":null,"errorMessage":"Unrecognized uint64 behavior: ${behavior.name()}","messagePattern":"Unrecognized uint64 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":138,"sourceCode":"      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    }\n  }\n\n  public static Builder builder() {\n    return new AutoValue_PrimitiveSbeField.Builder();\n  }\n\n  /** Builder for {@link PrimitiveSbeField}. */\n  @AutoValue.Builder\n  public abstract static class Builder {\n\n    public abstract Builder setName(String value);\n\n    public abstract Builder setIsRequired(Boolean value);\n\n    public abstract Builder setType(PrimitiveType value);\n\n    public abstract PrimitiveSbeField build();","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sbe/src/main/java/org/apache/beam/sdk/extensions/sbe/PrimitiveSbeField.java#L120-L156","documentation":"This IllegalStateException is thrown by PrimitiveSbeField.convertUint64 when the configured uint64Behavior matches none of the handled Behavior cases and falls to the default branch. It is an exhaustiveness guard against unknown or version-mismatched behavior values for 64-bit unsigned fields.","triggerScenarios":"Translating a uint64 SBE field whose SbeFieldOptions.unsignedOptions().uint64Behavior() holds a Behavior value not handled by the switch.","commonSituations":"New Behavior enum constants introduced in one component but not the other; options objects built incorrectly at runtime.","solutions":["Set uint64Behavior to one of SAME_BIT_SIGNED, HIGHER_BIT_SIGNED, CONVERT_TO_STRING, CONVERT_TO_BIG_DECIMAL.","Keep SbeFieldOptions and PrimitiveSbeField from the same Beam version.","Fix the uint64 behavior setting in SBE pipeline options.","Validate behavior values before running the transform."],"exampleFix":"// before\noptions.setUint64Behavior(unknownBehavior);\n// after\noptions.setUint64Behavior(Behavior.SAME_BIT_SIGNED);","handlingStrategy":"validation","validationCode":"Behavior b = options.unsignedOptions().uint64Behavior();\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 uint64Behavior: \" + b);\n}","typeGuard":null,"tryCatchPattern":"try {\n  pipeline.apply(SbeIO.readMessages(...));\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Unrecognized uint64 behavior\")) {\n    // set a supported uint64Behavior and rebuild the pipeline\n  }\n}","preventionTips":["Use only supported Behavior values for uint64Behavior.","Keep enum producers and consumers on the same Beam version.","Validate unsigned behaviors immediately after options construction.","Avoid ad-hoc enum values from configuration strings."],"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"}