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

[JAVA] clear should release the buffer only if the buffer is not NULL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • Java
    • None

    Description

      In some cases we use a fake allocator in Dremio for the purpose of field materialization only. The buffers of the underlying vectors are not allocated. Fake allocator is a simple implementation of BufferAllocator interface where almost every method throws UnsupportedOperation exception and methods like getEmpty() return NULL.

      It is more like a pass-through mechanism that allows us to be able to instantiate a vector using a non-functional allocator since the constructors in vector code don't allow for the allocator itself to be NULL.

      Portions of code where we have this scenario are generic in nature and so have typical methods like close() / clear() which underneath invoke the corresponding methods on vectors.

      The clear() method in BaseDataValueVector releases the data buffer without checking if the buffer is NULL and that's where callers hit NPE.

      We don't see such problems in Arrow unit tests. My guess is that when a vector is instantiated, the buffer is still probably a valid reference returned through allocator.getEmpty() call in the constructor of BaseDataValueVector.

      Attachments

        Activity

          People

            siddteotia Siddharth Teotia
            siddteotia Siddharth Teotia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: