{"record":{"id":"bcad87224451f8a2","repo":"apache/hadoop","slug":"splitpos-must-be-in-the-range","errorCode":null,"errorMessage":"splitPos must be in the range [{}, {}]: {}","messagePattern":"splitPos must be in the range \\[(.+?), (.+?)\\]: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java","lineNumber":69,"sourceCode":"  }\n\n  /**\n   * split a UTF-8 byte array into key and value \n   * assuming that the delimilator is at splitpos. \n   * @param utf utf-8 encoded string\n   * @param start starting offset\n   * @param length no. of bytes\n   * @param key contains key upon the method is returned\n   * @param val contains value upon the method is returned\n   * @param splitPos the split pos\n   * @param separatorLength the length of the separator between key and value\n   * @throws IOException\n   */\n  public static void splitKeyVal(byte[] utf, int start, int length, \n                                 Text key, Text val, int splitPos,\n                                 int separatorLength) throws IOException {\n    if (splitPos<start || splitPos >= (start+length))\n      throw new IllegalArgumentException(\"splitPos must be in the range \" +\n                                         \"[\" + start + \", \" + (start+length) + \"]: \" + splitPos);\n    int keyLen = (splitPos-start);\n    int valLen = (start+length)-splitPos-separatorLength;\n    key.set(utf, start, keyLen);\n    val.set(utf, splitPos+separatorLength, valLen);\n  }\n\n  /**\n   * split a UTF-8 byte array into key and value \n   * assuming that the delimilator is at splitpos. \n   * @param utf utf-8 encoded string\n   * @param start starting offset\n   * @param length no. of bytes\n   * @param key contains key upon the method is returned\n   * @param val contains value upon the method is returned\n   * @param splitPos the split pos\n   * @throws IOException\n   */","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java#L51-L87","documentation":"Error \"splitPos must be in the range [{}, {}]: {}\" thrown in apache/hadoop.","triggerScenarios":"A split position passed to StreamKeyValUtil is outside the allowed [begin, end] range of the input split.","commonSituations":"See trigger scenarios.","solutions":["Pass a split position within the key/value buffer bounds; the computed splitPos is out of range."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}