Commit 74e8981
authored
## What's Changed
For variable-size binary layout arrays, BufferImportTypeVisitor
currently derives the length of the value buffer by calculating the
difference between the last and first offset. When the first offset is
not zero, this is actually incorrect and leads to out of bounds errors
when attempting to read values from the imported array.
Instead, BufferImportTypeVisitor should simply use the last offset value
as the length of the value buffer. This PR makes that change.
Just FYI, I bumped into this issue when attempting to import an array
originating from DataFusion. A test query of the form `SELECT column1
FROM VALUES ('a'), ('b'), ('c'), ('d') LIMIT 2 OFFSET 1;` returns a
slice of the full set of values. The values buffer contains all the
original values, and the offsets buffer contains 1 and 2 as values to
handle the offset from the query.
Closes #709.
1 parent 3e135f4 commit 74e8981
File tree
1 file changed
+4
-8
lines changed- c/src/main/java/org/apache/arrow/c
1 file changed
+4
-8
lines changedLines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | 231 | | |
233 | | - | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
| |||
279 | 278 | | |
280 | 279 | | |
281 | 280 | | |
282 | | - | |
283 | 281 | | |
284 | | - | |
| 282 | + | |
285 | 283 | | |
286 | 284 | | |
287 | 285 | | |
| |||
296 | 294 | | |
297 | 295 | | |
298 | 296 | | |
299 | | - | |
300 | 297 | | |
301 | | - | |
| 298 | + | |
302 | 299 | | |
303 | 300 | | |
304 | 301 | | |
| |||
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
323 | | - | |
324 | 320 | | |
325 | | - | |
| 321 | + | |
326 | 322 | | |
327 | 323 | | |
328 | 324 | | |
| |||
0 commit comments