apache/hadoop · error · IllegalArgumentException

splitPos must be in the range [{}, {}]: {}

Error message

splitPos must be in the range [{}, {}]: {}

What it means

Error "splitPos must be in the range [{}, {}]: {}" thrown in apache/hadoop.

Source

Thrown at hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java:69

  }

  /**
   * split a UTF-8 byte array into key and value 
   * assuming that the delimilator is at splitpos. 
   * @param utf utf-8 encoded string
   * @param start starting offset
   * @param length no. of bytes
   * @param key contains key upon the method is returned
   * @param val contains value upon the method is returned
   * @param splitPos the split pos
   * @param separatorLength the length of the separator between key and value
   * @throws IOException
   */
  public static void splitKeyVal(byte[] utf, int start, int length, 
                                 Text key, Text val, int splitPos,
                                 int separatorLength) throws IOException {
    if (splitPos<start || splitPos >= (start+length))
      throw new IllegalArgumentException("splitPos must be in the range " +
                                         "[" + start + ", " + (start+length) + "]: " + splitPos);
    int keyLen = (splitPos-start);
    int valLen = (start+length)-splitPos-separatorLength;
    key.set(utf, start, keyLen);
    val.set(utf, splitPos+separatorLength, valLen);
  }

  /**
   * split a UTF-8 byte array into key and value 
   * assuming that the delimilator is at splitpos. 
   * @param utf utf-8 encoded string
   * @param start starting offset
   * @param length no. of bytes
   * @param key contains key upon the method is returned
   * @param val contains value upon the method is returned
   * @param splitPos the split pos
   * @throws IOException
   */

View on GitHub (pinned to 2add963021)

Solutions

  1. Pass a split position within the key/value buffer bounds; the computed splitPos is out of range.

When it happens

Trigger: A split position passed to StreamKeyValUtil is outside the allowed [begin, end] range of the input split.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/bcad87224451f8a2. Report an issue: GitHub.