[ 
https://issues.apache.org/jira/browse/DRILL-6629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554825#comment-16554825
 ] 

ASF GitHub Bot commented on DRILL-6629:
---------------------------------------

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:
us...@infra.apache.org


> BitVector split and transfer does not work correctly for transfer length < 8
> ----------------------------------------------------------------------------
>
>                 Key: DRILL-6629
>                 URL: https://issues.apache.org/jira/browse/DRILL-6629
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Execution - Data Types
>         Environment: BitVector split and transfer does not work correctly for 
> transfer length < 8.
>            Reporter: Karthikeyan Manivannan
>            Assignee: Karthikeyan Manivannan
>            Priority: Major
>             Fix For: 1.15.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to