ppadma commented on a change in pull request #1395: DRILL-6629 BitVector split 
and transfer does not work correctly for transfer length < 8
URL: https://github.com/apache/drill/pull/1395#discussion_r205824915
 
 

 ##########
 File path: 
exec/vector/src/main/java/org/apache/drill/exec/vector/BitVector.java
 ##########
 @@ -323,7 +323,8 @@ public void splitAndTransferTo(int startIndex, int length, 
BitVector target) {
       if (length % 8 != 0) {
         // start is not byte aligned so we have to copy some bits from the 
last full byte read in the
         // previous loop
-        byte lastButOneByte = byteIPlus1;
+        // if numBytesHoldingSourceBits == 1, lastButOneByte is the first 
byte, but we have not read it yet, so read it
+        byte lastButOneByte = (numBytesHoldingSourceBits == 1) ? 
this.data.getByte(firstByteIndex) : byteIPlus1;
 
 Review comment:
   ok. LGTM. +1.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to