Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6234

Improve Documentation of VariableWidthVector Behavior

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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:

      Description

      Doing the following will throw an Index out of bounds exception.

      
            final VarCharVector vector = new VarCharVector(field, allocator);
      
            vector.allocateNew();
            vector.getMutator().setValueCount(100);
      

      The expected behavior is to resize the array appropriately. If an index is uninitialized you should not call get for that index.

      
      	at org.apache.drill.exec.memory.BoundsChecking.checkIndex(BoundsChecking.java:80)
      	at org.apache.drill.exec.memory.BoundsChecking.lengthCheck(BoundsChecking.java:86)
      	at io.netty.buffer.DrillBuf.chk(DrillBuf.java:114)
      	at io.netty.buffer.DrillBuf.getInt(DrillBuf.java:484)
      	at org.apache.drill.exec.vector.UInt4Vector$Accessor.get(UInt4Vector.java:432)
      	at org.apache.drill.exec.vector.VarCharVector$Mutator.setValueCount(VarCharVector.java:729)
      	at org.apache.drill.exec.vector.VarCharVectorTest.testExpandingNonEmptyVectorSetValueCount(VarCharVectorTest.java:97)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
      

        Attachments

          Activity

            People

            • Assignee:
              timothyfarkas Timothy Farkas
              Reporter:
              timothyfarkas Timothy Farkas
              Reviewer:
              Paul Rogers

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment