hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject hive git commit: HIVE-18420 : LLAP IO: InputStream may return 0 bytes (Sergey Shelukhin via Prasanth J)
Date Wed, 10 Jan 2018 19:55:19 GMT
Repository: hive
Updated Branches:
  refs/heads/master 19e6a8b56 -> 134294310


HIVE-18420 : LLAP IO: InputStream may return 0 bytes (Sergey Shelukhin via Prasanth J)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/13429431
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/13429431
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/13429431

Branch: refs/heads/master
Commit: 134294310215e79bec5f189a5eb6cb7ea6734b4a
Parents: 19e6a8b
Author: Sergey Shelukhin <sershe@apache.org>
Authored: Wed Jan 10 11:54:32 2018 -0800
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Wed Jan 10 11:54:32 2018 -0800

----------------------------------------------------------------------
 .../hive/ql/io/orc/encoded/EncodedReaderImpl.java    | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/13429431/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
index 8c37a65..627e617 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/EncodedReaderImpl.java
@@ -1752,16 +1752,17 @@ class EncodedReaderImpl implements EncodedReader {
     }
 
     private boolean ensureRangeWithData() {
-      if (range != null && range.remaining() > 0) return true;
-      ++rangeIx;
-      if (rangeIx == ranges.size()) return false;
-      range = ranges.get(rangeIx).getByteBufferDup();
+      while (range == null || range.remaining() <= 0) {
+        ++rangeIx;
+        if (rangeIx == ranges.size()) return false;
+        range = ranges.get(rangeIx).getByteBufferDup();
+      }
       return true;
     }
 
     @Override
     public int read(byte[] data, int offset, int length) {
-      if (!ensureRangeWithData()) {
+     if (!ensureRangeWithData()) {
         return -1;
       }
       int actualLength = Math.min(length, range.remaining());
@@ -1814,6 +1815,7 @@ class EncodedReaderImpl implements EncodedReader {
       if (isTracingEnabled) {
         LOG.trace("Creating context: " + colCtxs[i].toString());
       }
+      trace.logColumnRead(i, colRgIx, ColumnEncoding.Kind.DIRECT); // Bogus encoding.
     }
     long offset = 0;
     for (OrcProto.Stream stream : streams) {
@@ -1824,7 +1826,8 @@ class EncodedReaderImpl implements EncodedReader {
       if ((StreamName.getArea(streamKind) == StreamName.Area.INDEX)
           && ((sargColumns != null && sargColumns[colIx])
               || (included[colIx] && streamKind == Kind.ROW_INDEX))) {
-          colCtxs[colIx].addStream(offset, stream, -1);
+        trace.logAddStream(colIx, streamKind, offset, length, -1, true);
+        colCtxs[colIx].addStream(offset, stream, -1);
         if (isTracingEnabled) {
           LOG.trace("Adding stream for column " + colIx + ": "
               + streamKind + " at " + offset + ", " + length);


Mime
View raw message