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

[Java] BaseVariableWidthVector/BaseLargeVariableWidthVector setNull and getBufferSizeFor is buggy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 4.0.0
    • Java

    Description

      We may get error java.lang.IndexOutOfBoundsException: index: 15880, length: 4 (expected: range(0, 15880)).

      I test on arrow 2.0.0

      Reproduce code in scala:

      
      import org.apache.arrow.vector.VarCharVector
      import org.apache.arrow.memory.RootAllocator
      val rootAllocator = new RootAllocator(Long.MaxValue)
      val v1 = new VarCharVector("var1", rootAllocator)
      v1.allocateNew()
      
      val valueCount = 3970 // use any number >= 3970 will get similar error
      
      for (idx <- 0 until valueCount) {
        v1.setNull(idx)
      }
      v1.getBufferSizeFor(valueCount) # failed, get error java.lang.IndexOutOfBoundsException: index: 15880, length: 4 (expected: range(0, 15880))
      
      

      Attachments

        Issue Links

          Activity

            People

              weichenxu123 Weichen Xu
              weichenxu123 Weichen Xu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 7.5h
                  7.5h