Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer Between Empty Lists Should Not Invoke Callback #16825

Closed
asfimport opened this issue Jun 29, 2017 · 1 comment
Closed

Transfer Between Empty Lists Should Not Invoke Callback #16825

asfimport opened this issue Jun 29, 2017 · 1 comment

Comments

@asfimport
Copy link

Here's the test that fails:

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

Reporter: Sudheesh Katkam
Assignee: Abdel Hakim Deneche / @adeneche

Note: This issue was originally created as ARROW-1162. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Abdel Hakim Deneche / @adeneche:
Issue resolved by pull request 791
#791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant