You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Weichen Xu (Jira)" <ji...@apache.org> on 2021/01/12 14:24:00 UTC

[jira] [Updated] (ARROW-11223) BaseVariableWidthVector setNull and getBufferSizeFor is buggy, may get error java.lang.IndexOutOfBoundsException: index: 15880, length: 4 (expected: range(0, 15880))

     [ https://issues.apache.org/jira/browse/ARROW-11223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Weichen Xu updated ARROW-11223:
-------------------------------
    Description: 
I test on arrow 0.15.1

Reproduce code in scala:

{code}

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

{code}

  was:

I test on arrow 0.15.1

Reproduce code in scala:

{code: 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))

{code}


> BaseVariableWidthVector setNull and getBufferSizeFor is buggy, may get error  java.lang.IndexOutOfBoundsException: index: 15880, length: 4 (expected: range(0, 15880))
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-11223
>                 URL: https://issues.apache.org/jira/browse/ARROW-11223
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 0.15.1
>            Reporter: Weichen Xu
>            Priority: Major
>
> I test on arrow 0.15.1
> Reproduce code in scala:
> {code}
> 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))
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)