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

Transfer Between Empty Lists Should Not Invoke Callback

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.4.1
    • Fix Version/s: 0.5.0
    • Component/s: Java
    • Labels:
      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

            People

            • Assignee:
              adeneche Deneche A. Hakim
              Reporter:
              sudheeshkatkam Sudheesh Katkam
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: