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_r204918913
##########
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:
@bitblender I think there could be a problem here. please check. If you are
copying say from firstBitOffset 2, length 4. We want to copy 4 bits only. But,
this might copy 6 bits. bitsFromLastButOneByte will be all bits from
firstBitOffset to the end of the byte.
----------------------------------------------------------------
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