Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.8.3, 1.10.1, 1.11.2, 1.12.2
-
None
Description
The method HadoopStreams.wrap wraps an FSDataInputStream to a SeekableInputStream.
It checks whether the underlying stream of the passed FSDataInputStream implements ByteBufferReadable: if true, wraps the FSDataInputStream to H2SeekableInputStream; otherwise, wraps to H1SeekableInputStream.
In some cases, we may add another wrapper over FSDataInputStream. For example,
class CustomDataInputStream extends FSDataInputStream { public CustomDataInputStream(FSDataInputStream original) { super(original); } }
When we create an FSDataInputStream, whose underlying stream does not implements ByteBufferReadable, and then creates a CustomDataInputStream with it. If we use HadoopStreams.wrap to create a SeekableInputStream, we may get an error like
java.lang.UnsupportedOperationException: Byte-buffer read unsupported by input stream
We can fix this by taking recursive checks over the underlying stream of FSDataInputStream.
Attachments
Issue Links
- relates to
-
PARQUET-2151 Drop Hadoop 2 input stream reflection from parquet-hadoop
-
- Open
-
-
HADOOP-18336 tag FSDataInputStream.getWrappedStream() @Public/@Stable
-
- Resolved
-