You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by GitBox <gi...@apache.org> on 2022/03/16 07:20:03 UTC
[GitHub] [parquet-mr] 7c00 commented on a change in pull request #951: PARQUET-2134: Fix type checking in HadoopStreams.wrap
7c00 commented on a change in pull request #951:
URL: https://github.com/apache/parquet-mr/pull/951#discussion_r827693142
##########
File path: parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util/HadoopStreams.java
##########
@@ -66,6 +67,15 @@ public static SeekableInputStream wrap(FSDataInputStream stream) {
}
}
+ private static boolean isWrappedStreamByteBufferReadable(FSDataInputStream stream) {
+ InputStream wrapped = stream.getWrappedStream();
+ if (wrapped instanceof FSDataInputStream) {
+ return isWrappedStreamByteBufferReadable(((FSDataInputStream) wrapped));
Review comment:
Yes, it could be. But it may be hard to create such a case. As its code shows, FSDataInputStream is a wrapper class of an inputstream. When we check the wrapped inputstream recursively, it would finally reach an inputstream whose type is not FSDataInputStream. A developer could override `getWrappedStream` as `return this`, while this makes no sence.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@parquet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org