pavibhai commented on a change in pull request #635:
URL: https://github.com/apache/orc/pull/635#discussion_r574124194



##########
File path: java/core/src/java/org/apache/orc/impl/BufferChunk.java
##########
@@ -69,22 +69,8 @@ public final String toString() {
 
   @Override
   public DiskRange sliceAndShift(long offset, long end, long shiftBy) {
-    assert offset <= end && offset >= this.offset && end <= this.end;
-    assert offset + shiftBy >= 0;
-    ByteBuffer sliceBuf = chunk.slice();
-    int newPos = (int) (offset - this.offset);
-    int newLimit = newPos + (int) (end - offset);
-    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 + shiftBy);
+    // Method has no code references
+    throw new UnsupportedOperationException();

Review comment:
       I have gone through the change again carefully. This is not required for 
the current implementation, so I will revert this change here and we can take 
this up independently if needed




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to