This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-swift.git
The following commit(s) were added to refs/heads/main by this push:
new 8886eac fix: Honor useUnalignedBuffers in ArrowReader.readStreaming
(#179)
8886eac is described below
commit 8886eac8fde4e2dcba6e537b9cbe305bc9403df1
Author: maltzsama <[email protected]>
AuthorDate: Sat Jul 25 00:44:14 2026 +0200
fix: Honor useUnalignedBuffers in ArrowReader.readStreaming (#179)
## What's Changed
`readStreaming` declared a `useUnalignedBuffers` parameter and ignored
it,
hardcoding `allowReadingUnalignedBuffers: true` when constructing the
`ByteBuffer`. This forwards the caller's value, matching `readFile` and
`fromMessage`, which already do so.
## Testing
The full test suite passes with this change.
No new test is included: the flag selects between aligned and unaligned
loads inside FlatBuffers and does not affect the result of any read on
this
path, because `ByteBuffer(data:)` copies the input into aligned storage.
A
test exercising the parameter would pass both with and without this
change,
so it would not guard against a regression.
The streaming reader is already covered by `IPCStreamReaderTests` and
the
streaming cases in `IPCFileReaderTests`.
Closes #178.
Co-authored-by: demetrius albuquerque <[email protected]>
---
Sources/Arrow/ArrowReader.swift | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Sources/Arrow/ArrowReader.swift b/Sources/Arrow/ArrowReader.swift
index 830d9c0..d1c0853 100644
--- a/Sources/Arrow/ArrowReader.swift
+++ b/Sources/Arrow/ArrowReader.swift
@@ -277,7 +277,7 @@ public class ArrowReader { // swiftlint:disable:this
type_body_length
streamData = input[offset...]
var dataBuffer = ByteBuffer(
data: streamData,
- allowReadingUnalignedBuffers: true
+ allowReadingUnalignedBuffers: useUnalignedBuffers
)
let message: org_apache_arrow_flatbuf_Message =
getRoot(byteBuffer: &dataBuffer)
switch message.headerType {