Github user hsuanyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/262#discussion_r45541995
  
    --- Diff: 
exec/java-exec/src/test/java/org/apache/drill/exec/memory/TestAllocators.java 
---
    @@ -63,6 +69,53 @@
       private final static String planFile="/physical_allocator_test.json";
     
       @Test
    +  public void testDrillBufReadIndex() throws Exception {
    +    final int length = 10;
    +
    +    final Properties props = new Properties() {
    +      {
    +        put(TopLevelAllocator.TOP_LEVEL_MAX_ALLOC, "1000000");
    +        put(TopLevelAllocator.ERROR_ON_MEMORY_LEAK, "true");
    +      }
    +    };
    +    final DrillConfig config = DrillConfig.create(props);
    +
    +    final BufferAllocator allc = RootAllocatorFactory.newRoot(config);
    +    final TypeProtos.MajorType.Builder builder = 
TypeProtos.MajorType.newBuilder();
    +    builder.setMinorType(TypeProtos.MinorType.INT);
    +    builder.setMode(TypeProtos.DataMode.REQUIRED);
    +
    +    final IntVector iv = new IntVector(MaterializedField.create("Field", 
builder.build()), allc);
    +    iv.allocateNew();
    +
    +    // Write data to DrillBuf
    +    for(int i = 0; i < length; ++i) {
    +      iv.getBuffer().writeInt(i);
    +    }
    +
    +    // Read data to DrillBuf
    +    for(int i = 0; i < length; ++i) {
    +      assertEquals((long) i, (long) iv.getBuffer().readInt());
    --- End diff --
    
    Yes, It is not necessary. Just cleaned it.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to