-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-44910: [Swift] Fix IPC stream reader and writer impl #45029
base: main
Are you sure you want to change the base?
Conversation
|
@@ -216,7 +216,67 @@ public class ArrowReader { // swiftlint:disable:this type_body_length | |||
return .success(RecordBatch(arrowSchema, columns: columns)) | |||
} | |||
|
|||
public func fromStream( // swiftlint:disable:this function_body_length | |||
public func fromMemoryStream( // swiftlint:disable:this function_body_length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment that explains the difference between fromMemoryStream
and fromFileStream
?
var schemaMessage: org_apache_arrow_flatbuf_Schema? | ||
while length != 0 { | ||
if length == CONTINUATIONMARKER { | ||
offset += Int(MemoryLayout<Int32>.size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the size of length data?
How about using UInt32
not Int32
because length data is UInt32 not Int32?
Rationale for this change
Fixes IPC incorrect stream format issue.
Changes have been tested with:
This PR includes breaking changes to public APIs.
Writer and reader APIs have changed:
Reader:
fromStream -> fromFileStream
Writer:
toStream -> toFileStream