-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Swift][FlightSQL] Processing valid RecordBatch leads to invalid offset from body's data. #37726
Comments
@abandy Could you take a look at this? |
Yes, will do. |
@mgrazianoc Can you share the test case that hits this error? |
Hi, I think the issue was due to the flat buffer data. I'm still learning about the weeds, so here's what I've tried that worked:
Now, I'm trying to figure it out how to convert from an array of |
Hi @mgrazianoc, it looks like a test for calling doGet with a flightDataClosure is missing. I will submit a PR to add the missing test case. In the meantime, here is the test code for getting the data from the flightDataClosure into a RecordBatch:
Once you have the record batches you should be able to call ArrowTable.from(recordBatchs: [RecordBatch]) to build the ArrowTable. |
Now I'm getting back the func doGet() async throws {
let ticket = FlightTicket("TEST".data(using: .utf8)!)
var recordBatches = [RecordBatch]()
try await client?.doGet(ticket, flightDataClosure: { flightData in
let reader = ArrowReader();
let result = reader.fromStream(flightData.dataBody)
switch result {
case .success(let readerResult):
for rb in readerResult.batches {
recordBatches.append(rb)
}
case .failure(let error):
throw error
}
})
let table = ArrowTable.from(recordBatches: recordBatches)
print(table)
} Arrow table being sent (it also raises with more complex ones), through https://arrow.apache.org/docs/python/generated/pyarrow.flight.RecordBatchStream.html: pyarrow.Table
TEST_STRING: string
----
TEST_STRING: [["testString"]] |
@mgrazianoc Seems the behavior of the swift impl and existing flight implementations were different. I have added a PR to update the swift behavior to match existing implementations. Please test against it when you get a chance: #37764. To run the flight test against "python/examples/flight/server.py" you will need to change the data sent to the doGetTest* methods to (as the python test server uses an encoding of the ticketdescriptor to build the lookup keys):
|
I think just before we can close the issue, after the great work made by @abandy, there's one more bug relating to the arrow-flight Sending Sending the |
Could you open a new issue for the another bug? |
I reopen this because #37764 isn't merged yet. |
I've opened the other error in the #37884 issue. |
…g impls (#37764) Swift Flight implementation behavior didn't match existing flight implementations. The updates in this PR have been tested against python/examples/flight/server.py except for getSchemaTest and doExchangeTest which are not implemented in server.py. I will follow up this PR with a cleanup refactoring PR. This difference in behavior was found due to issue #37726. * Closes: #37726 Authored-by: Alva Bandy <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
…xisting impls (apache#37764) Swift Flight implementation behavior didn't match existing flight implementations. The updates in this PR have been tested against python/examples/flight/server.py except for getSchemaTest and doExchangeTest which are not implemented in server.py. I will follow up this PR with a cleanup refactoring PR. This difference in behavior was found due to issue apache#37726. * Closes: apache#37726 Authored-by: Alva Bandy <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
…xisting impls (apache#37764) Swift Flight implementation behavior didn't match existing flight implementations. The updates in this PR have been tested against python/examples/flight/server.py except for getSchemaTest and doExchangeTest which are not implemented in server.py. I will follow up this PR with a cleanup refactoring PR. This difference in behavior was found due to issue apache#37726. * Closes: apache#37726 Authored-by: Alva Bandy <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Describe the bug, including details regarding any error messages, version, and platform.
Bug
During
FlightClient.doGet
call,ArrowReader
process an emptydataBody
on a valid flight data, raisingFatal error: UnsafeRawBufferPointer.load with negative offset
. However,dataHeader
is present.Details
A valid flight call tested both in
python
andrust
was also tested in the not yet released Swift package. The ticket is a simpleTEST
raw byte, in order for the server to start a simple stream of RecordBatch.Error Messages
System details
Xcode Version 15.0 beta 8 (15A5229m)
Screenshots
Component(s)
Swift
The text was updated successfully, but these errors were encountered: