drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hnfgns <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-3920 Add vector loading tests
Date Mon, 12 Oct 2015 22:39:35 GMT
Github user hnfgns commented on a diff in the pull request:

    https://github.com/apache/drill/pull/194#discussion_r41808984
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/record/vector/TestValueVector.java
---
    @@ -223,14 +231,187 @@ public void testNullableVarLen2() {
         }
       }
     
    +  private static DrillBuf combineBuffers(final BufferAllocator allocator, final DrillBuf[]
buffers) {
    +    // find the total size we'll need
    +    int size = 0;
    +    for(final DrillBuf buffer : buffers) {
    +      size += buffer.readableBytes();
    +    }
    +
    +    // create the new buffer
    +    final DrillBuf newBuf = allocator.buffer(size);
    +    final DrillBuf writeBuf = newBuf;
    +    for(final DrillBuf buffer : buffers) {
    +      final DrillBuf readBuf = (DrillBuf) buffer.slice();
    +      final int nBytes = readBuf.readableBytes();
    --- End diff --
    
    not a show stopper but the whole loop here could be replaced with ByteBuf#readBytes or
ByteBuf#getBytes I think.


---
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