arrow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sudheesh Katkam (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ARROW-1162) Transferring Empty List Should Not Invoke Callback
Date Thu, 29 Jun 2017 04:54:00 GMT
Sudheesh Katkam created ARROW-1162:
--------------------------------------

             Summary: Transferring Empty List Should Not Invoke Callback
                 Key: ARROW-1162
                 URL: https://issues.apache.org/jira/browse/ARROW-1162
             Project: Apache Arrow
          Issue Type: Bug
          Components: Java - Vectors
    Affects Versions: 0.4.1
            Reporter: Sudheesh Katkam
             Fix For: 0.5.0


Here's the test that fails:

{code}
public class TestBufferOwnershipTransfer {

  //...

  private static class Pointer<T> {
    T value;
  }

  private static CallBack newTriggerCallback(final Pointer<Boolean> trigger) {
    trigger.value = false;
    return new CallBack() {
      @Override
      public void doWork() {
        trigger.value = true;
      }
    };
  }

  @Test
  public void emptyListTransferShouldNotTriggerSchemaChange() {
    final BufferAllocator allocator = new RootAllocator(Integer.MAX_VALUE);

    final Pointer<Boolean> trigger1 = new Pointer<>();
    final Pointer<Boolean> trigger2 = new Pointer<>();
    final ListVector v1 = new ListVector("v1", allocator,
            FieldType.nullable(ArrowType.Null.INSTANCE),
            newTriggerCallback(trigger1));
    final ListVector v2 = new ListVector("v2", allocator,
            FieldType.nullable(ArrowType.Null.INSTANCE),
            newTriggerCallback(trigger2));

    v1.makeTransferPair(v2).transfer();

    assertFalse(trigger1.value);
    assertFalse(trigger2.value); // fails
  }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message