You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "aakshintala (via GitHub)" <gi...@apache.org> on 2023/02/01 03:40:23 UTC
[GitHub] [arrow] aakshintala opened a new issue, #33966: The ArrowIPC Java library doesn't respect buffer offsets set in the flatbuffer metadata
aakshintala opened a new issue, #33966:
URL: https://github.com/apache/arrow/issues/33966
### Describe the bug, including details regarding any error messages, version, and platform.
The `Buffer Alignment and Padding` [section](https://arrow.apache.org/docs/format/Columnar.html#buffer-alignment-and-padding) of the Arrow Columnar Format Specification allows padding to be either 8-bytes or 64-bytes with 64-bytes being preferred for SIMD performance reasons.
I have a custom implementation of the Arrow Columnar Format (serialization and deserialization only as we operate on an entirely different columnar format) where I pad all of my data buffers to 64-bytes when serializing. This works fine with the C++, Python and Rust libraries (and I think with the Go library as well) as they all use the `offset` value from the flatbuffer `Buffer` message when calculating where to read the next body buffer from...
The Java library however, seems to assume that the padding will always be 8-bytes and just pads the size of the `n-1`th buffer to 8-bytes when calculating the offset for the `n`th buffer. This assumption obviously breaks when the padding size is anything other than 8-bytes...
Would it be acceptable to bring the Java library in-line with the remaining implementations, i.e., have it respect the offset from the flatbuffer metadata?
### Component(s)
Java
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] aakshintala commented on issue #33966: [Java] The ArrowIPC Java library doesn't respect buffer offsets set in the flatbuffer metadata
Posted by "aakshintala (via GitHub)" <gi...@apache.org>.
aakshintala commented on issue #33966:
URL: https://github.com/apache/arrow/issues/33966#issuecomment-1412269530
Yes the Java library is reading the data incorrectly. It thinks the data body buffer starts at offset 8 (as the validity buffer only has 8 bytes of data) in the example above. However, the data buffer is actually at offset 64 as I'm padding all of my body buffers to 64.
I'm considering just going back to 8 byte padding in my implementation for now, but I think the Java library should respect the offset value in the Buffer metadata and not just add size of the previous buffer to calculate the offset of the next buffer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] aakshintala commented on issue #33966: The ArrowIPC Java library doesn't respect buffer offsets set in the flatbuffer metadata
Posted by "aakshintala (via GitHub)" <gi...@apache.org>.
aakshintala commented on issue #33966:
URL: https://github.com/apache/arrow/issues/33966#issuecomment-1411418157
Specifically:
What my library produces:
> ArrowRecordBatch [length=64, nodes=[ArrowFieldNode [length=64, nullCount=0]], #buffers=2, buffersLayout=[ArrowBuffer [offset=0, size=8], **ArrowBuffer [offset=64, size=128]], body length = 192**]
What the Java library deserializes:
> ArrowRecordBatch [length=64, nodes=[ArrowFieldNode [length=64, nullCount=0]], #buffers=2, buffersLayout=[ArrowBuffer [offset=0, size=8], **ArrowBuffer [offset=8, size=128]], body_length = 136**]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] lidavidm commented on issue #33966: [Java] The ArrowIPC Java library doesn't respect buffer offsets set in the flatbuffer metadata
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #33966:
URL: https://github.com/apache/arrow/issues/33966#issuecomment-1412549507
Thanks. That indeed sounds like a bug. A PR would be welcome.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] lidavidm commented on issue #33966: [Java] The ArrowIPC Java library doesn't respect buffer offsets set in the flatbuffer metadata
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on issue #33966:
URL: https://github.com/apache/arrow/issues/33966#issuecomment-1412033031
I'm not sure what the problem is. To be clear, is Java reading the data incorrectly?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] aakshintala commented on issue #33966: [Java] The ArrowIPC Java library doesn't respect buffer offsets set in the flatbuffer metadata
Posted by "aakshintala (via GitHub)" <gi...@apache.org>.
aakshintala commented on issue #33966:
URL: https://github.com/apache/arrow/issues/33966#issuecomment-1412793034
Okay so. This turned out to be a red herring for my particular issue... There was a bug in my implementation... Fixing that fixed the incorrect data issue.
The issue still remains that the calculation of bufferLayouts in [ArrowRecordBatch.java](https://github.com/apache/arrow/blob/7eeb74edaf29031ee1c9b0547c03a46a94323477/java/vector/src/main/java/org/apache/arrow/vector/ipc/message/ArrowRecordBatch.java#L118) is incorrect... Those computed layouts are used by the `toString()` function and apparently only for Java-specific testing (Java<->Java roundtrip). The wrong buffer offsets reported via the `toString()` function drove me down the wrong path.. 🤦🏽♂️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org