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

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

HanumathRao commented on a change in pull request #1316: DRILL-6486: BitVector 
split and transfer does not work correctly for non byte-multiple transfer 
lengths
URL: https://github.com/apache/drill/pull/1316#discussion_r194814756
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/vector/TestSplitAndTransfer.java
 ##########
 @@ -77,4 +79,84 @@ public void test() throws Exception {
     varCharVector.close();
     allocator.close();
   }
+
+  /**
+   *  BitVector tests
+   */
+
+  enum TestBitPattern {
+    ZERO,
+    ONE,
+    ALTERNATING,
+    RANDOM
+  }
+
+  @Test
+  public void testBitVectorUnalignedStart() throws Exception {
+    testBitVectorImpl(3443, new int[][] {{0, 2047}, {2047, 1396}}, 
TestBitPattern.ZERO);
+    testBitVectorImpl(3443, new int[][] {{0, 2047}, {2047, 1396}}, 
TestBitPattern.ONE);
+    testBitVectorImpl(3443, new int[][] {{0, 2047}, {2047, 1396}}, 
TestBitPattern.ALTERNATING);
+    testBitVectorImpl(3443, new int[][] {{0, 2047}, {2047, 1396}}, 
TestBitPattern.RANDOM);
+
+    testBitVectorImpl(3447, new int[][] {{0, 2047}, {2047, 1400}}, 
TestBitPattern.ZERO);
+    testBitVectorImpl(3447, new int[][] {{0, 2047}, {2047, 1400}}, 
TestBitPattern.ONE);
+    testBitVectorImpl(3447, new int[][] {{0, 2047}, {2047, 1400}}, 
TestBitPattern.ALTERNATING);
+    testBitVectorImpl(3447, new int[][] {{0, 2047}, {2047, 1400}}, 
TestBitPattern.RANDOM);
+  }
+
+  @Test
+  public void testBitVectorAlignedStart() throws Exception {
+    testBitVectorImpl(3444, new int[][] {{0, 2048}, {2048, 1396}}, 
TestBitPattern.ZERO);
+    testBitVectorImpl(3444, new int[][] {{0, 2048}, {2048, 1396}}, 
TestBitPattern.ONE);
+    testBitVectorImpl(3444, new int[][] {{0, 2048}, {2048, 1396}}, 
TestBitPattern.ALTERNATING);
+    testBitVectorImpl(3444, new int[][] {{0, 2048}, {2048, 1396}}, 
TestBitPattern.RANDOM);
+
+    testBitVectorImpl(3448, new int[][] {{0, 2048}, {2048, 1400}}, 
TestBitPattern.ZERO);
+    testBitVectorImpl(3448, new int[][] {{0, 2048}, {2048, 1400}}, 
TestBitPattern.ONE);
+    testBitVectorImpl(3448, new int[][] {{0, 2048}, {2048, 1400}}, 
TestBitPattern.ALTERNATING);
+    testBitVectorImpl(3448, new int[][] {{0, 2048}, {2048, 1400}}, 
TestBitPattern.RANDOM);
+  }
+
+  int getBit(TestBitPattern pattern, int index) {
+    if (pattern == TestBitPattern.RANDOM) {
+      final int randomBit = (int) (Math.random() * 2);
 
 Review comment:
   I was just thinking if bitValue is better than randomBit?

----------------------------------------------------------------
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 non byte-multiple 
> transfer lengths
> -------------------------------------------------------------------------------------------
>
>                 Key: DRILL-6486
>                 URL: https://issues.apache.org/jira/browse/DRILL-6486
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>    Affects Versions: 1.13.0
>            Reporter: Karthikeyan Manivannan
>            Assignee: Karthikeyan Manivannan
>            Priority: Major
>             Fix For: 1.14.0
>
>         Attachments: TestSplitAndTransfer.java
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> BitVector splitAndTransfer does not correctly handle transfers where the 
> transfer-length is not a multiple of 8. The attached bitVector tests will 
> expose this problem. 



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

Reply via email to