apache/hadoop · warning · UnsupportedOperationException

skip not supported

Error message

skip not supported

What it means

S3ARemoteInputStream.skip() always throws UnsupportedOperationException("skip not supported"). Skipping forward must be done by seek(pos + n) on this seekable stream; the InputStream skip idiom (reading and discarding) was deliberately not implemented.

Source

Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/prefetch/S3ARemoteInputStream.java:483

      throw new EOFException(FSExceptionMessages.CANNOT_SEEK_PAST_EOF + " " + pos);
    }
  }

  // Unsupported functions.

  @Override
  public void mark(int readlimit) {
    throw new UnsupportedOperationException("mark not supported");
  }

  @Override
  public void reset() {
    throw new UnsupportedOperationException("reset not supported");
  }

  @Override
  public long skip(long n) {
    throw new UnsupportedOperationException("skip not supported");
  }
}

View on GitHub (pinned to 2add963021)

Solutions

  1. Replace skip(n) with seek(getPos() + n) on the seekable stream.
  2. Guard generic code: if (!stream.markSupported() && stream instanceof Seekable) { seek } else { skip } - or simply prefer seek on FSDataInputStream.
  3. Wrap the stream in BufferedInputStream, whose skip() works by buffered reads.
  4. Keep utility readers configurable to use seek-based positioning for Hadoop streams.

Example fix

// before
long remaining = n;
while (remaining > 0) { remaining -= stream.skip(remaining); } // throws

// after
if (stream instanceof org.apache.hadoop.fs.Seekable) {
  ((org.apache.hadoop.fs.Seekable) stream).seek(stream.getPos() + n);
}
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: Calling skip(n) on the prefetcher's remote stream - often from libraries that use skip() as their standard 'advance' operation (compression streams, archive readers); test code using skip in read loops.

Common situations: Tools (gzip/zip/tar readers) that skip headers or entries; frameworks defaulting to skip() instead of seek() on FSDataInputStream; ported local-filesystem code.

Related errors


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