{"record":{"id":"6864de2dbe501505","repo":"apache/beam","slug":"unknown-startkeycase","errorCode":null,"errorMessage":"Unknown startKeyCase: ","messagePattern":"Unknown startKeyCase: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java","lineNumber":748,"sourceCode":"    private final ByteString value;\n    private final boolean isClosed;\n\n    @NonNull\n    static StartPoint extract(@NonNull RowRange rowRange) {\n      switch (rowRange.getStartKeyCase()) {\n        case STARTKEY_NOT_SET:\n          return new StartPoint(ByteString.EMPTY, true);\n        case START_KEY_CLOSED:\n          return new StartPoint(rowRange.getStartKeyClosed(), true);\n        case START_KEY_OPEN:\n          if (rowRange.getStartKeyOpen().isEmpty()) {\n            // Take care to normalize an open empty start key to be closed.\n            return new StartPoint(ByteString.EMPTY, true);\n          } else {\n            return new StartPoint(rowRange.getStartKeyOpen(), false);\n          }\n        default:\n          throw new IllegalArgumentException(\"Unknown startKeyCase: \" + rowRange.getStartKeyCase());\n      }\n    }\n\n    private StartPoint(@NonNull ByteString value, boolean isClosed) {\n      this.value = value;\n      this.isClosed = isClosed;\n    }\n\n    @Override\n    public int compareTo(@NonNull StartPoint o) {\n      return ComparisonChain.start()\n          // Empty string comes first\n          .compareTrueFirst(value.isEmpty(), o.value.isEmpty())\n          .compare(value, o.value, ByteStringComparator.INSTANCE)\n          // Closed start point comes before an open start point: [x,y] starts before (x,y].\n          .compareTrueFirst(isClosed, o.isClosed)\n          .result();\n    }","sourceCodeStart":730,"sourceCodeEnd":766,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableServiceImpl.java#L730-L766","documentation":"When converting a RowRange's start key into an internal StartPoint, BigtableServiceImpl switches over the protobuf startKeyCase. If the case is none of START_KEY_CLOSED, START_KEY_OPEN (i.e. the range is in an unexpected/uninitialized state), an IllegalArgumentException with 'Unknown startKeyCase: ' is thrown.","triggerScenarios":"Passing a RowRange to BigtableIO.withKeyRange whose start key is unset — e.g. a default-constructed RowRange without setStartKeyClosed/setStartKeyOpen, or a range built from a different proto version where the oneof field isn't populated.","commonSituations":"Programmatically building RowRanges and forgetting to set a start key; deserializing ranges from external config where the start key field was dropped.","solutions":["Always set one of startKeyClosed or startKeyOpen on the RowRange before passing it to BigtableIO.withKeyRange","Use RowRange.newBuilder().setStartKeyClosed(ByteString.EMPTY) to scan from the beginning of the table","Log/print rowRange.getStartKeyCase() to verify which case your range actually has"],"exampleFix":"// before\nRowRange range = RowRange.newBuilder().setEndKeyExclusive(end).build(); // no start key\n// after\nRowRange range = RowRange.newBuilder()\n    .setStartKeyClosed(ByteString.EMPTY)\n    .setEndKeyExclusive(end)\n    .build();","handlingStrategy":"validation","validationCode":"boolean hasStartKey(RowRange r) {\n  return r.getStartKeyCase() != RowRange.StartKeyCase.STARTKEY_NOT_SET;\n}","typeGuard":"boolean startKeySet(RowRange range) {\n  return range.getStartKeyCase() == RowRange.StartKeyCase.START_KEY_CLOSED\n      || range.getStartKeyCase() == RowRange.StartKeyCase.START_KEY_OPEN;\n}","tryCatchPattern":null,"preventionTips":["Always call setStartKeyClosed/setStartKeyOpen when constructing ranges","Treat an empty start key as setStartKeyClosed(ByteString.EMPTY), not omitted","Unit-test range builders to assert the oneof case is set"],"tags":["gcp","bigtable","argument","range"],"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"}