drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben-Zvi <...@git.apache.org>
Subject [GitHub] drill pull request #901: DRILL-5709: Provide a value vector method to conver...
Date Sat, 12 Aug 2017 01:43:37 GMT
Github user Ben-Zvi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/901#discussion_r132806694
  
    --- Diff: exec/vector/src/main/java/org/apache/drill/exec/vector/BaseValueVector.java
---
    @@ -133,5 +134,21 @@ public static boolean checkBufRefs(final ValueVector vv) {
       public BufferAllocator getAllocator() {
         return allocator;
       }
    +
    +  public static void fillBitsVector(UInt1Vector bits, int valueCount) {
    +
    +    // Create a new bits vector, all values non-null
    +
    +    bits.allocateNew(valueCount);
    +    UInt1Vector.Mutator bitsMutator = bits.getMutator();
    +    for (int i = 0; i < valueCount; i++) {
    +      bitsMutator.set(i, 1);
    +    }
    --- End diff --
    
    This loop may be a bit expensive; Is there a way to mark the whole bitmap with '1's "at
once" ?  A la "memset()".  
    For example, keep a constant bitmap (of max length - 64K) someplace, and here just dup/copy
it whole.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message