Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1557#discussion_r187199413
--- Diff: core/sql/src/main/java/org/trafodion/sql/HDFSClient.java ---
@@ -151,10 +180,38 @@ public Object call() throws IOException
bufOffset_ += bytesRead;
pos_ += bytesRead;
lenRemain_ -= bytesRead;
- } while (lenRemain_ > 0);
+ } while (lenRemain_ > 0);
return new Integer(totalBytesRead);
}
- }
+ }
+
+ int compressedFileRead(int readLenRemain) throws IOException
+ {
+ int totalReadLen = 0;
+ int readLen;
+ int offset = 0;
+ int retcode;
+
+ int lenRemain = ((readLenRemain > bufArray_.length) ?
bufArray_.length : readLenRemain);
--- End diff --
Negative might return an exception in read operation, while 0 might be
harmless. I think forcing read at least once would help us to set the isEOF_
flag
---