You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2015/02/26 01:17:50 UTC

svn commit: r1662338 - in /hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc: RecordReaderImpl.java RecordReaderUtils.java

Author: sershe
Date: Thu Feb 26 00:17:49 2015
New Revision: 1662338

URL: http://svn.apache.org/r1662338
Log:
Add logging for some bug

Modified:
    hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java
    hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java?rev=1662338&r1=1662337&r2=1662338&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java Thu Feb 26 00:17:49 2015
@@ -3068,8 +3068,16 @@ public class RecordReaderImpl implements
       ByteBuffer sliceBuf = chunk.slice();
       int newPos = (int)(offset - this.offset);
       int newLimit = newPos + (int)(end - offset);
-      sliceBuf.position(newPos);
-      sliceBuf.limit(newLimit);
+      // TODO: temporary
+      try {
+        sliceBuf.position(newPos);
+        sliceBuf.limit(newLimit);
+      } catch (Throwable t) {
+        LOG.error("Failed to slice buffer chunk with range" + " [" + this.offset + ", " + this.end
+            + "), position: " + chunk.position() + " limit: " + chunk.limit() + ", "
+            + (chunk.isDirect() ? "direct" : "array") + "; to [" + offset + ", " + end + ") " + t.getClass());
+        throw new RuntimeException(t);
+      }
       return new BufferChunk(sliceBuf, offset);
     }
 

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java?rev=1662338&r1=1662337&r2=1662338&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java Thu Feb 26 00:17:49 2015
@@ -285,7 +285,8 @@ public class RecordReaderUtils {
           file.readFully(buffer, 0, buffer.length);
           directBuf.put(buffer);
         }
-        directBuf.position(0);
+        directBuf.position(startPos);
+        directBuf.limit(startPos + len);
         range = range.replaceSelfWith(new BufferChunk(directBuf, range.offset));
       } else {
         byte[] buffer = new byte[len];