Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-1162

Transfer Between Empty Lists Should Not Invoke Callback

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.4.1
    • 0.5.0
    • Java
    • None

    Description

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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            adeneche Abdel Hakim Deneche
            sudheeshkatkam Sudheesh Katkam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment