apache/hadoop · error · IOException

Uninitialized InputSplit

Error message

Uninitialized InputSplit

What it means

Error "Uninitialized InputSplit" thrown in apache/hadoop.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/join/CompositeInputSplit.java:64

  private int fill = 0;
  private long totsize = 0L;
  private InputSplit[] splits;
  private Configuration conf = new Configuration();

  public CompositeInputSplit() { }

  public CompositeInputSplit(int capacity) {
    splits = new InputSplit[capacity];
  }

  /**
   * Add an InputSplit to this collection.
   * @throws IOException If capacity was not specified during construction
   *                     or if capacity has been reached.
   */
  public void add(InputSplit s) throws IOException, InterruptedException {
    if (null == splits) {
      throw new IOException("Uninitialized InputSplit");
    }
    if (fill == splits.length) {
      throw new IOException("Too many splits");
    }
    splits[fill++] = s;
    totsize += s.getLength();
  }

  /**
   * Get ith child InputSplit.
   */
  public InputSplit get(int i) {
    return splits[i];
  }

  /**
   * Return the aggregate length of all child InputSplits currently added.
   */

View on GitHub (pinned to 2add963021)

Solutions

  1. Ensure CompositeInputSplit.set() is called to populate the child splits before the split is read or used.
  2. Check that the job used CompositeInputFormat to generate the splits so each CompositeInputSplit is fully initialized.

Example fix

CompositeInputSplit split = new CompositeInputSplit(children.length);
split.set(children); // must be called before use

When it happens

Trigger: Thrown by CompositeInputSplit.getLocation()/getLocations() when they are called before the split has been initialized with its child splits and locations (i.e. before readFields/add). Always populate the split via readFields() before querying locations.

Common situations: Manually constructing CompositeInputSplit without calling set(); deserializing a split whose readFields() was skipped.


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